Has Twisted Changed Its Dependencies?
Solution 1:
One of your own files, /home/cdecker/dev/acn/acn_a4/src/operator.py
shadows Python's builtin operator
module. You should rename your own operator.py
to something else.
You can see the problem here:
File "/usr/lib/python2.5/site-packages/Twisted-10.0.0-py2.5-linux-i686.egg/twisted/python/compat.py", line 146, in <module>
import operator
File "/home/cdecker/dev/acn/acn_a4/src/operator.py", line 7, in <module>
Twisted tries to import operator
but Python loads one of your own modules.
To prevent stuff like that in the future you should probably not add your src folder to the PYTHONPATH like that. Create a package instead, so that your own files appear as myproject.mymodule
and can't shadow builtins.
Solution 2:
ImportError
is raised on import
statement when a name cannot be imported, because module or package or name doesn't exists. In your case attrgetter
doesn't exists in operator
module.
The first idea is that you define a module called operator
in the project's main directory. Modules, or packages, are searched following sys.path
order, if you define a module with the same name in your main directory, you are hiding all others module with the same name in the search path.
Post a Comment for "Has Twisted Changed Its Dependencies?"