Pycharm detected global interpreter instead venv
Hi! I'm trying to assoсiate my existing project with venv. I selected my venv in Python Interpreter in my project settings. Terminal shows: '(venv) C:\Users\...' - looks like ok. But result 'where python' is: 'C:\Users\myUser\AppData\Local\Programs\Python\Python37\python.exe' - global interpreter. So 'pip list' shows global packages instead venv packages. How can I fix it?
Please sign in to leave a comment.
Could you please attach screenshots of the
[Project Interpreter Settings](https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html#interpreter-settings) and Terminal settings https://www.jetbrains.com/help/pycharm/settings-tools-terminal.html?
the same
Could you please attach a screenshot of interpreter paths https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-reloading-interpreter-paths.html#view?
And the output of the script :
Hello,
Thank you for the output.
While I am investigating, please activate the same venv in command line and run ``where python``. Will you have the same result? Please attach a screenshot as well.
Hi! So, this situation isn't PyCharm's problem but i think you can make new helpful feature.
It happens if rename/change venv's parent directory.
The solve:
It will be very unpleasant if you forget call peep > freeze then change project's and venv's directory then call pip > freeze again - pip will be executed as global, but not venv. And you requirements.txt will have global packages.
If PyCharm show me this notification (or solve this problem itself) it will be cool.
But now, I can't repeat this problem because when I try to move my project and open it in PyCharm and change project interpreter - all working good.