Twisted中的twistd无法在窗口中运行
在命令提示符下,我输入>>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.twistd
python时, twistd位于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
,它可以运行
in command prompt i type >>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.twistd
the twistd is at 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()
when i type
from twisted.scripts.twistd import run
in python ,it can be run
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试设置路径..在cmd中类似这样:
然后运行twistd
Try setting path.. something like this in cmd:
and then run twistd