python - Twisted 中的 twistd 无法在窗口中运行

标签 python window twisted xmpp

在命令提示符下输入 >>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

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

在python中可以运行

最佳答案

尝试设置路径.. 在 cmd 中像这样:

set PYTHONPATH=%PYTHONPATH%;C:\My_python_lib   

然后运行twistd

关于python - Twisted 中的 twistd 无法在窗口中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3450806/

相关文章:

java - 如何修复JavaFX中舞台启动时可见位置的跳转?

javascript - JS如何循环多次打开新标签

android模拟器不会在窗口中打开

python - 快速的 python/jython IPC?

python - XmlStream.addObserver 中的 XPath 无法按应有的方式工作

python - 如何使用 ipywidgets fileupload 上传大文件?

python - unicodedata.unidata_version 打印错误的 unicode 版本?

python - twisted + gtk : should I run GUI things in threads, 还是在 react 器线程中?

python - 对于使用 python 的 Codility 类(class) MaxCounters,是否有可能比 O(N+M) 更好?

python - 如何在 python 中调用包含函数作为参数的 cython cdef() 函数?