Search code examples
pythonwindowspycharm

Why python interpreter not using venv


I set up virtual env in my pycharm and i have interpreter of python in that venv and my console shows me that im using that but for some reason i still have packages of my main interpreter

How can i solve that?

This is my venv interpreter and im using it enter image description here

But for some reason in terminal i still has previous intrepreter from another project enter image description here

enter image description here

enter image description here


Solution

  • In that terminal, you can run which python3 (outside of the Python REPL). You should see it's not your Desktop folder's venv python...

    You need to use cmd.exe for the terminal. Then you need to invoke the activate.bat file of the venv in that folder before running py3/python3 or pip commands.

    Otherwise, use Pycharm's built-in pip management dialog which should automatically link to the project interpreter, rather than modify PyCharm terminal settings for all projects.