I have a Python project set up in a virtualenv that I created directly from the terminal. When I try to open it in PyCharm, I am able to see the files, but I can't change the project interpreter to use my virtualenv. I am able to see the python executable file both through the WSL terminal and the Windows File Explorer, but when I try to add it as a project interpreter from PyCharm, I am unable to find it.
I have tried deleting my .idea
directory and adding the project to PyCharm again. I have tried creating a new project in PyCharm using my project's root directory. I have tried editing the SDK_HOME
variable in .idea/workspace.xml
to be the location of the python executable, but it didn't change the project interpreter.
Anyone have any ideas?
I am using WSL for the terminal and Windows 10 for my OS.
It is probably because what you have is a symlink and not a copy of the interpreter. Try creating the environment by adding the --copies
option:
virtualenv myenv --copies
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.