Problem Statement
My PyCharm project does not recognize any Virtualenv project interpreter, including ones it successfully creates.
Steps Taken to Produce Error
I opened PyCharm to the Welcome to PyCharm window.
I clicked Get from Version Control
. I cloned a private repo from my GitHub into my local system. I confirmed that all files from the repo were present.
I opened the Add Python Interpreter
window via File -> Settings -> Project: myProject -> Project Interpreter -> (gear button) -> "Add..."
.
I selected the Virtualenv Environment
option and the New environment
radio button. I confirmed that the target Location (...myProjectvenv)
did not yet exist. I selected Python 3.7 as my base interpreter, an installation which I have used without issue in other projects. I left both Inherit global site-packages
and Make available to all projects
unchecked.
PyCharm successfully created the Virtualenv. I confirmed this in both PyCharm's Project tab and Windows Explorer. Double-clicking ...myProjectvenvScriptspython.exe
launched a Python 3.7 shell as expected.
However, PyCharm's infobar at the bottom of the main window said <No interpreter>
. The Project Interpreter settings menu also said <No interpreter>
, and upon expanding the interpreter list dropdown, the interpreter which PyCharm had just successfully created for myProject was not listed.
Note
After taking the above steps, the newly-created Virtualenv is listed as an option under the Existing Interpreter
radio button. However, selecting this option does nothing; the Project Interpreter window still says <No interpreter>
.
Failed Remedies
- Closing and Reopening PyCharm.
- Choosing the
Existing Interpreter
radio button and targeting myProjectvenvScriptspython.exe
.
- Choosing the
Existing Interpreter
radio button and targeting the python.exe
in a different project's Virtualenv.
- Restarting my computer then
Existing Interpreter -> myProjectvenvScriptspython.exe
.
- Creating a second Virtualenv
(myProjectvenv-2)
.
- Deleting all existing Virtualenvs, then creating a new one in
myProjectvenv
.
Leads
Creating a new, separate project (myProject_2)
using the exact same steps as above does NOT replicate the error; a new Virtualenv is successfully created and recognized. This error is unique to myProject
.
Regardless, I'm going to leave this question up. I want to understand what's going wrong here.
[Project Directory Structure]
myProject
assets
css
images
js
MyProject
courses
migrations
templates
courses
templatetags
templates
users
migrations
templates
users
templatetags
venv
[Info]
Microsoft Windows 10 Pro
PyCharm 2019.3.3
Python 3.7.7
question from:
https://stackoverflow.com/questions/65909088/pycharm-does-not-recognize-the-interpreter-it-just-created 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…