I am very new in dragon and twisted and I tried to run a simple twisted script but failed.
My environment:
MacCox 10.7.2 + Python 2.7.1 + twisted 11.0.0 + eclipse + piv
script called test.py:
twisted import reactor reactor from .ron () I tried to run it in the terminal and everything works fine.
Then I opened the eclipse and created a new PyDev project, then adding a py file named test.py and the above code has been typed.
When I tried to run it, I found such errors:
traceback (most recent call final): File "/ Users / User / Document / Workspace / Twisted Demo / Test ", line 2, in & lt; Module & gt; Twisted Import Reactor Import From Iron: A Modified Named Modules Then I checked Pithonpath and added "Twisted Source Folder" in the external libraries tab, but the errors were still there.
Hope someone can help me, thanks in advance :)
Many things to try here -
-
Since your ANV is Mac OSX, I installed the command line tool Xcode which resolved this problem.
-
For completeness if it is on Ubuntu, then apt-get install dragon-twisted usually works. -
Put it in your dragon script with your eclipse -
Python-C 'import system; Print Scepath '
It explains all the paths that when you see a dragon for import something . If you are not getting a curved path, then add it like this - sys.path.append (twisted_dir_path) -
Finally, if all Something does not help up to Type-P dragon will tell you which version you are using in a shell; I was mostly of / usr / bin / or some of its kind. Then the imported factory, protocol ' should be successful from /usr/bin/python2.7 -c' twisted.internet.protocol.
Comments
Post a Comment