Content Root Recognized as "." instead of "Project"

I have a project that is going to be compiled into a python package.

I want to have code completion within my package so I can easily create new functions in one part of the package and import then in other parts.

I have to following structure:

Project/
 > PartA/
 > PartB/

Pycharm would not complete the following import:
From Project.PartA import component.

When I go to my project structure settings, I see that the "Project" folder is marked as ".", and I cannot rename it.

Any suggestions?

0
3 comments
Avatar
Permanently deleted user

After fiddling a bit, I re-defined the content root of the project to be the parent folder, and marked "Project" as source root.

(So I now have:
Parent/ - content root
 > Project/ - source root
 > > PartA/
 > > PartB/)

I then had to mark all other files and directories in the parent as excluded, and create a new scope to not see them.

so now I am able to import from "PartA" but not from "PartB" and I cannot understand what is the difference between them and why only on works.

Any ideas?

0
Avatar
Permanently deleted user

So now I just found out that auto import is working perfectly (!!!) but still pycharm won't give me suggestions. that is, when I type "from Project." only "PartA" is suggested but not "PartB", but when I type a name of a variable or function from "PartB" pycharm is able to suggest that as an import.

HELP! T^T

0
Avatar
Permanently deleted user

Eventually I was able to fix this by assigning "Parent" to be content root.

0

Please sign in to leave a comment.