Reputation: 10843
This issue has come up with previous versions of PyCharm (see this SO post and this one), but it manifests somewhat differently in 4.5.
I am trying to add another library to the Python path of my current project. This is an internal library and consists of a bunch of .py
files in a different directory from the current project. I carry out the following steps:
File -> Settings -> Project: summary -> Project Interpreter
More...
from the context menu that pops up+
in the resulting popupHaving done this, the result is:
PYTHONPATH
I have even tried File -> Invalidate Caches / Restart...
and pressed the Invalidate and Restart
button that appears. After sitting and waiting for indexing to finish, I get the same result. I have been very careful with setting the right path, and it seems to be correct, given that running the code actually works.
Does anyone know of a workaround for this issue, short of adding the external code as a content root?
Upvotes: 3
Views: 755
Reputation: 10843
Checked w/ JetBrains support, they confirmed that the only ways to add external libraries to a PyCharm project are:
Not the cleanest approaches, as they both basically mean adding the other library's actual code to your project. But they are the only ones at this point.
Upvotes: 1
Reputation: 133
I ran into a very similar issue. I am working on an OpenStack component, and all third-party libraries were getting marked as unresolved references. It turned out to be because the .tox
directory is automatically excluded by PyCharm, which prevents any virtual environments in that directory from getting indexed properly.
To fix this, I went to the Editor > File Types
dialog of the Preferences
menu, and removed the .tox
folder from the Ignore files and folders
option.
Upvotes: 1