在窗户下扭曲

ale*_*lex 1 python windows twisted

扭曲位于C:\ Python26\Lib\site-packages\Twisted-11.0.0-py2.6-win32.egg\twisted

C:\projects\webmorda>twistd -n morda_server
Traceback (most recent call last):
  File "C:\Python26\Scripts\twistd.py", line 4, in <module>
    import pkg_resources
  File "C:\Python27\lib\site-packages\pkg_resources.py", line 2671, in <module>
    working_set.require(__requires__)
  File "C:\Python27\lib\site-packages\pkg_resources.py", line 654, in require
    needed = self.resolve(parse_requirements(requirements))
  File "C:\Python27\lib\site-packages\pkg_resources.py", line 552, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: twisted==11.0.0
Run Code Online (Sandbox Code Playgroud)

怎么了?

msa*_*ers 6

看起来你已经在Python 2.6环境中安装了Twisted,但是使用Python 2.7来运行它.我认为以下命令应该有效:

C:\Python26\python.exe C:\Python26\Scripts\twistd.py -n morda_server
Run Code Online (Sandbox Code Playgroud)

(看起来该twistd.py脚本由与.py文件扩展名相关联的python.exe二进制文件运行 - 在您的情况下似乎是Python 2.7.或者您有一个PYTHONPATH环境变量设置为指向Python 2.7站点 -包目录.)