help with dependency cycle

hi all..

I have a project which i can run from the command line, but when i run it within pycharm (just run - no debugger), i see:

Traceback (most recent call last):
  File "/data/app/cent5_i386/PyCharm/1.2.0/helpers/pydev/", line 2, in <module>
    from pydevd_constants import * #@UnusedWildImport
  File "/data/app/cent5_i386/PyCharm/1.2.0/helpers/pydev/", line 37, in <module>
    import threading
  File "/data/app/cent5_x86_64/Python/2.5.2/python/lib/python2.5/", line 13, in <module>
    from collections import deque
  File "/data/home/aikend/workspace/Kamole-trunk/library/python/", line 12, in <module>
    from Kamole.config.python import configuration
  File "/data/home/aikend/workspace/Kamole-trunk/config/", line 8, in <module>
    import os, sys, logging, cherrypy, sqlalchemy, sqlalchemy.orm
  File "/data/app/python/modules/cent5_x86_64_py25/Cherrypy/3.1.0/cherrypy/", line 159, in <module>
    from cherrypy import _cpdispatch as dispatch
  File "/data/app/python/modules/cent5_x86_64_py25/Cherrypy/3.1.0/cherrypy/", line 13, in <module>
    from cherrypy import wsgiserver
  File "/data/app/python/modules/cent5_x86_64_py25/Cherrypy/3.1.0/cherrypy/wsgiserver/", line 82, in <module>
    import Queue
  File "/data/app/cent5_x86_64/Python/2.5.2/python/lib/python2.5/", line 4, in <module>
    from collections import deque
ImportError: cannot import name deque

It looks like PyCharm is getting confused because it's picking up the deque from an unexpected source in the PYTHONPATH. Perhaps, for its own needs, it should pick it up from the python interpreter?

Comment actions Permalink

Hi David,

it looks like that deque is imported by python threading module which is used by pycharm debugger. And it is strange because PyCharm debugger shouldn't be in your PYTHONPATH if you use simple run, not debug. Could you please provide your sys.path value.



Comment actions Permalink

Just checked - the PyCharm directories are not in sys.path. The PYTHONPATH contains 43 entries, most of which are custom in-house tools. Those which are not custom tools are:

'/data/app/cent5_x86_64/Pymel/1.0.2/pymel', /data/app/cent5_x86_64/Maya/2011.5.315/maya/lib/python2.6/site-packages', '/data/app/cent5_x86_64/Python/2.6.4/python/lib/', '/data/app/cent5_x86_64/Python/2.6.4/python/lib/python2.6', '/data/app/cent5_x86_64/Python/2.6.4/python/lib/python2.6/plat-linux2', '/data/app/cent5_x86_64/Python/2.6.4/python/lib/python2.6/lib-tk', '/data/app/cent5_x86_64/Python/2.6.4/python/lib/python2.6/lib-old', '/data/app/cent5_x86_64/Python/2.6.4/python/lib/python2.6/lib-dynload', '/data/app/cent5_x86_64/Python/2.6.4/python/lib/python2.6/site-packages']


Please sign in to leave a comment.