Why is Python SDK removing folders from Classpath
I have lots of Python packages installed in not-default folder: /usr/local/lib/python2.7/site-packages (Default is detected by Intellij in /Library/Python/2.7/site-packages). To make it work I add the folder into Classpath settings (Platform Settings -> SDKs -> Python 2.7.10 -> Classpath) and it works. But every time an update to Intellij, Python plugin or maybe even each restart of Intellij causes the path to be automatically removed from the Classpath. It's really irritating. How can I make it stop?
请先登录再写评论。
Yeah, I also experience that. But it's every time I restart the IDE. Is there a way to set it permanently?
For me even if I close and reopen a project, even without closing IntelliJ, it removes the manually-added directories from the project's SDK. Please allow changes to persist!
Issue is still there, any updates?
Can anyone from JetBrains comment on the logic that is used to decide to remove a manually added path?
I think I discovered a little bit of info here that may be useful to others:
- IntelliJ appears to add/remove classpaths according to what it sees in the PYTHONPATH environment variable.
- If an IntelliJ module (i.e., with a corresponding .iml file) is in the same directory as a classpath, IntelliJ may decide to remove it
I can't say for sure that these are hard truths.
Am experiencing this as well and it's driving me nuts and seriously hacking into my productivity...
This happens to me with a local pip -e install. It's in a virtualenv. I have other virtualenvs with the same pip installed library... they are fine. Just this one, keeps deleting the classpath. The others had it added automatically, no problems.
I may have fixed it by going to File -> Project Structure -> Platform Settings -> SDKs and simply setting "Python SDK home path" to the same file. I clicked to change it, selected that same file that was already there in the file chooser, pressed ok, applied changes. Then all the classpaths disappeared. I closed the project, reopened, and things seem to be good. It has loaded the classpaths for my venv and my missing library is there.
Update: This worked, but then next day, it had removed the pip package again. What...
Ugh this drives me nuts. When you add something to project settings -> platform settings -> sdk -> {the plus button} -> and then apply, it should stay longer than 3 minutes before it magically vanishes.
And yet this problem is unsolved :(
This fixes it for me https://stackoverflow.com/questions/13994846/intellij-python-plugin-run-classpath/29804378