I have an application at work that is configured with the following structure.
/project_root /applications /app1 __init__.py /app2 __init__.py ... /appN /pkg /database __init__.py /toolbox __init__.py ... __init__.py __init__.py main_framework.py
I am learning to use PyCharm (community edition) instead of the Eclipse PyDev tool. In __init__.py in app1 , I have an import statement that looks like this:
import pkg.database
PyCharm complains about importing with the message no module named pkg .
(click to enlarge)
Due to how the structure is built, the system works very well. Each of appN knows about the pkg directory. How do I tell PyCharm that I have custom modules in the pkg directory to stop these warnings?
I am testing PyCharm 4.0.3 Community Edition.
A few things I tried, thanks for the comments below that didn't help:
- In the Project Structure dialog box, project_root was listed as the only directory in the Content Root section on the right side of the dialog box. I added the
pkg directory so that it is also listed. It had no effect. - In the original version of the question, I skipped
__init__.py in pkg when displaying the structure. This file exists.
source share