0

I am trying to execute the following import command:

from twisted.web.server import NOT_DONE_YET

I am able to do it just fine in the interpreter, but when I execute it in a .py script, I get the error message:

ImportError: No module named web.server

For some reason "web.server" is being interpreted as a module, as opposed to it being interpreted as the twisted/web/ directory > server.py file > NOT_DONE_YET variable.

user279043
  • 111
  • 1

1 Answers1

0

The reason was because I had a filed named "twisted.pyc" in the same directory as my script, so it is looking in that file instead of the Twisted folder installed in the site-packages directory.

user279043
  • 111
  • 1