2010-08-10 55 views
3

在命令提示i型>> twistd來echobot.tac運行twistd來在扭曲不能在窗口

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 \腳本\ 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() 

當我在Python類型

from twisted.scripts.twistd import run 

,它可以運行

+0

這是什麼版本的扭曲,你是怎麼安裝呢? – Glyph 2010-11-18 17:01:44

+0

oww ...我已經忘了...但是這個問題是在窗口中...現在我使用Ubuntu的,像魅力工作 – wizztjh 2010-11-19 05:32:29

+0

Twisted的某些版本並沒有完全安裝在Windows上自己。我相信這是固定的當前版本。 – 2011-03-18 19:52:55

回答

2

嘗試設置路徑..這樣的事情在CMD:

set PYTHONPATH=%PYTHONPATH%;C:\My_python_lib 

,然後運行twistd來