pythonpycharmvirtualenv

Pycharm Terminal not working properly on Windows 10 with VirtualEnv


I've been working on a Django project using Pycharm 2019.3, and I've been stuck on this issue for days now. I downloaded the project from a repo and have been working well in it, but the terminal is not working properly, for example, when I type even something like 'python --version', it says Python is not recognized, and the same happens with Pip.

If the terminal doesn't recognize python, even, there are a lot of things I can't do. I know the problem is probably with Pycharm or the terminal itself, because if I type the same on the CMD, it works just fine and recognizes python and pip. The commands work anywhere, and on CMD and PowerShell, just not on the Pycharm terminal. However, I have to use the Pycharm terminal because the project uses a virtual environment, right?

I'm relatively inexperienced, but I think if I use the CMD anywhere else, I'd just not be within the virtual environment, right? I believe I have to install packages and work on the Pycharm terminal, not just anywhere. The python version is 3.6, and I have the environment variables set, otherwise the python command wouldn't be recognized anywhere. Any help to fix this or a workaround would save me a lot of time.

EDIT:


Solution

  • You have to configure your Pycharm. Go to Run->Edit Configurations->Set the Python interpreter to your virtual env path https://www.jetbrains.com/help/pycharm-edu/configuring-local-python-interpreters.html