Top-level of external library sources is detected incorrectly


I have WSGI project in PyCharm. It uses virtualenv. I installed repoze.what library, but, in contrast to other libraries, its top-level package detected incorrectly.

Screen shot 2012-08-22 at 9.23.26 AM.png

As you can see, only adapters package is root, but repoze and what also must be. As in SQLAlchemy, for example:

Screen shot 2012-08-22 at 9.41.25 AM.png

Do you have any ideas how to solve it?

Comment actions Permalink
Please try PyCharm 2.6 EAP, which adds support for namespace packages:
Comment actions Permalink
Hi, Dmitry!

I tried it on PyCharm 2.6.1. Autoimport by Cmd+Enter works, import are added, but they are still incorrect.

Screen shot 2012-09-17 at 10.18.22 AM.png
Comment actions Permalink
The parent directory of repoze should be listed as a root in your interpreter settings (PyCharm should do it automatically under normal circumstances, let's find out why it didn't).

Please provide more details on 1) what are your root folders (static paths: Settings -> Python Interpreters -> (Your interpreter) -> Path, dynamic paths: import sys; print(sys.path) in the command line inside PyCharm), 2) how did you create your virtualenv and install packages into it.
Comment actions Permalink
Hi, Andrey!

Thanks for quick reply.

Here is sys.path output:

import sys
print sys.path

['/Applications/', '/Users/Marboni/Projects/ODM/ODM-API/env/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg', '/Users/Marboni/Projects/ODM/ODM-API/env/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg', '/Users/Marboni/Projects/ODM/ODM-API/env/lib/', '/Users/Marboni/Projects/ODM/ODM-API/env/lib/python2.7', '/Users/Marboni/Projects/ODM/ODM-API/env/lib/python2.7/plat-darwin', '/Users/Marboni/Projects/ODM/ODM-API/env/lib/python2.7/plat-mac', '/Users/Marboni/Projects/ODM/ODM-API/env/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/Marboni/Projects/ODM/ODM-API/env/lib/python2.7/lib-tk', '/Users/Marboni/Projects/ODM/ODM-API/env/lib/python2.7/lib-old', '/Users/Marboni/Projects/ODM/ODM-API/env/lib/python2.7/lib-dynload', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/Marboni/Projects/ODM/ODM-API/env/lib/python2.7/site-packages', '/Users/Marboni/Projects/ODM/ODM-API/odmapi']

Interpreter's paths:

Screen shot 2012-09-18 at 8.20.58 AM.png

I created virtualenv by following way:

/Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv /Users/Marboni/Projects/ODM/ODM-API/env

(–no-site-packages flag is deprecated).

I install packages using pip from /Users/Marboni/Projects/ODM/ODM-API/env/bin directory.

I'd like to notice again that this issue occurs with repoze packages only, other detected well.
Comment actions Permalink
Hi Boris,
the problem with repoze.what is that it has no files in packages repoze and what. That's why PyCharm doesn't treat them as packages.
Comment actions Permalink
Hi, traff.

You're right, it seems to be incorrect. I'll write to repoze devs to solve it.

Thank you.
Comment actions Permalink not exists because of bug in pip.

It doesn't occur if package installed with easy_install.

Please sign in to leave a comment.