I have two pure python projects in PyCharm 3.4.1 Professional Edition. The first one, let\'s call it p
(like package), is structured as a setuptools package (i.
I just had same problem like yours.
Seems pycharm can not recognize module installed directly by setup.py, but can recognize module installed by pip. Finally, I use pip install src_path, but I got to pip install it everytime I modify source code.
As of Pycharm 2016.1.4 (professional edition), it seems that opening a different project (e.g. through Open Recent) and then opening the original one makes Pycharm reindex the installed packages and hence recognize the develop-installed packages.
This is enough for me.
I have Just installed package using Pycharm then problem solved.
The problem could be your interpreter path. Check where the interpreter is pointing to. In most cases it is ~/PycharmProjects/trials/venv/bin/python and this could be pointing to a python bath installed as part of Pycharm
Change the softlink of python to your /usr/bin/python path and things should work fine
Solution
In the drop-down list, click Show all.... The available interpreters show up in the Project Interpreters dialog.
Select the desired interpreter.
In the toolbar of the Project Interpreters dialog box, click the button icon show paths (last option). The existing paths of the selected interpreter show up in the Interpreter Paths dialog box.
voila!! you are good to go.
Explanation
Each project refers to an interpreter which you can find in settings->project interpreter. Now this interpreter uses a bunch of Paths to look for a library. By default it has site-packages and bunch of other paths there.
Now since you used pip develop -e or python setup.py develop, a dynamic link is created pointing to your package's repository instead of a package installation in site-packages directory. So our package's source path is not here, What we need to do is to add our source path to interpreter's Paths to make it work
Ref:
In the project pane, the directory which holds p needs to be marked as source. Available under: Right-click -> "Mark Directory As" -> "Sources Root".
Note: This setting will also add it to PYTHONPATH during execution from the run menu if the corresponding check box for the option is checked in "Edit Configurations" (default).