PyCharm installing packages out of the virtual environment default path
已完成
I am running a PyCharm project (please exit the numpy source tree, and relaunch
your python interpreter from there.) in a conda-managed virtual environment (venv_project).
The path to the virtual environment is ~/miniconda3/envs/venv_project/, which matches the Python interpreter setting in PyCharm. But I don't understand why PyCharm is installing all the new packages in the project folder (~/PycharmProjects/project/proj/lib64/python3.12/site-packages/) instead of the default venv_project's path (~/miniconda3/envs/venv_project/lib/python3.10/site-packages).
How can I make PyCharm install packages in the default venv_project path?
帖子评论已关闭。
I've also had this issue. I found a workaround on how to fix this by just installing packages directly in terminal, but it would be ideal to have Pycharm install packages into the project environment (not project only) automatically without needing to configure this myself. HELP
This issue requires a more detailed investigation, so I’ve created a YouTrack issue for it: https://youtrack.jetbrains.com/issue/PY-89736
To pinpoint exactly which interpreter PyCharm is using when it installs packages, could you share the following in the YouTrack ticket?
1) The full PyCharm version (Help | About > copy the build line)
2) A screenshot of Settings | Python | Interpreter, with the interpreter dropdown expanded so all configured interpreters are visible
3) The output of these commands run inside PyCharm's built-in Terminal (View | Tool Windows | Terminal), so we see which Python the IDE-side shell activates:
4) The contents of
~/PycharmProjects/VOLT-Platforms/VOLT/so we can confirm whether a venv lives there:5) A screenshot of your active Run/Debug Configuration (Run | Edit Configurations), specifically the "Python interpreter" field - a run config can override the project interpreter
6) IDE logs collected via Help | Collect Logs and Diagnostic Data (this packages logs into a zip; please attach it).
For background, here are the relevant docs:
- https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html
- https://www.jetbrains.com/help/pycharm/package-installation-issues.html