2011-09-22 35 views
1

扭下扭:\ Python26 \ LIB \站點包\扭11.0.0-py2.6-win32.egg \扭曲位於C窗戶

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 

有什麼不對?

回答

6

看起來您已經在Python 2.6環境中安裝了Twisted,但使用Python 2.7來運行它。我想下面的命令應該工作:

C:\Python26\python.exe C:\Python26\Scripts\twistd.py -n morda_server 

(它看起來像twistd.py腳本是由與.py文件擴展名關聯的python.exe二進制運行 - 而你的情況似乎是Python 2.7版或者你有一個PYTHONPATH環境變量設置爲指向Python 2.7站點包目錄。)

+1

PYTHONPATH幫助,謝謝 – alex