Cannot auto complete import for shared namespace

My project structure is set up with several packages starting with the same namespace (nti). These packages are all on my pythonpath and resolve fine in pycharm (no red squiggle). My issue comes when I try to import like from nti.*, only one package appears here. Is there a certain way I need to setup pycharm to be compatible with this setup? I also see this behavior for dependencies I have like zope, from zope.* only displays one option (zope.browserresource) when there should be several (zope.interface, zope.component, etc).

5 comments

Hi, does the imports themselves work correctly? Is this just a false positive issue?

Also, in addition to project structure, please ensure that your package directories are included in the interpreter paths which can be found in the project interpreter settings (gear icon > show all > interpreter paths)

Before that though, it might be a good idea to run python console, and print your sys.path there, to see if your package dirs are there, but if the imports are actually working, they should be there.

0

Yes, the imports themselves resolve correctly. If I finish out the path into the actual package, then the names start to be suggested again. My sys.path looks like I would expect with my packages.

Trying to have nti.app.products.courseware suggested

First, products isn't suggested at all


Once I type in products, only gradebook is suggested. This is a valid package but there are multiple others in this namespace I would expect such as courseware


Now I finish out the actual package name and I start getting suggestions again

 

It seems as though there is some kind of race condition or namespacing conflict that is causing suggestions to fail, but I can't figure out how to configure the pycharm settings in such a way to get around this. 

0

Thanks.

logs-20190315-150913.zip

0

Are you using any virtual environment for your project, and what type? From what I understand the issue shouldn't be project specific, so can you please create a new project, install the same packages, reproduce the issue, then zip the project directory along with it's virtual environment and upload to the ftp? If I can reproduce it on my side it should be easy to find the root cause.

0

Please sign in to leave a comment.