Reputation: 1962
I am facing a strange issue in PyCharm. I have defined a virtual environment "(venv)
" having Python3.8
as base as interpreter for project along with rest of packages required for the project. The same is selected in project run/debug
configuration as well. See pictures below.
My virtual environment has Python-3.8, however, when I try to run project, it tries to run the project with Python-3.7 present elsewhere in the PC. Here is that pic :
Furthermore, the interpreter listed in PyCharm at bottom right of the screen is correct as shown in figure:
I have seen a similar question answered here: PyCharm not using my configured virtualenv interpreter however the remedy suggested there doesn't work for me.
Upvotes: 1
Views: 1927
Reputation: 1962
After help from a lot of colleagues at work, I finally found the bugger. In the Run/Debug configuration, there is a checkbox saying "include parent environment variables" checkbox which was checked in my case. And that was the problem. For this reason, the virtual environment interpreter was being over-ridden. This checkbox can be found as shown in images below :
Upvotes: 2