在命令提示符下键入>>twistd echobot.tac
Traceback (most recent call last):
File "C:\Python26\Scripts\twistd.py", line 18, in ?
from twisted.scripts.twistd import run
ImportError: No module named twisted.scripts.twistdtwistd在C:\Python26\Scripts\twistd.py上
#!c:\python26\python.exe
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
### Twisted Preamble
# This makes sure that users don't have to set up their environment
# specially in order to run these programs from bin/.
import sys, os, string
if string.find(os.path.abspath(sys.argv[0]), os.sep+'Twisted') != -1:
sys.path.insert(0, os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),os.pardir, os.pardir)))
if hasattr(os, "getuid") and os.getuid() != 0:
sys.path.insert(0, os.path.abspath(os.getcwd()))
### end of preamble
from twisted.scripts.twistd import run
run()当我输入的时候
from twisted.scripts.twistd import run在python中,它可以运行
发布于 2011-05-04 00:40:56
尝试设置路径..在cmd中类似这样:
set PYTHONPATH=%PYTHONPATH%;C:\My_python_lib 然后运行twistd
https://stackoverflow.com/questions/3450806
复制相似问题