Twistd in Twisted can not starts in a window

at the 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 twist is in 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

+3
source share
1 answer

Try setting the path .. something like this in cmd:

set PYTHONPATH=%PYTHONPATH%;C:\My_python_lib   

and then run twistd

+2
source

Source: https://habr.com/ru/post/1758951/


All Articles