Failed to create interpreter venv\bin\python not found

Been trying to solve this for the past few days and I cannot get pycharm to create a new virtual environment.  And each time I try I get the following error and can't find any info to debug/solve this.

I uninstallled PyCharm, Python, cleared out path env, caches in AppData, TMP, and Program Files but still receive the same error.  Additionally when I reinstall I've installed it in this order Python 3.8.1, PIP, and then PyCharm to make sure everything is available.

 

OS: Windows 10

Python Version: 3.8.1

PIP Version: 19.2.3

 

 

 

And when I try to use the system environment I get this warning.

And when trying to install packages via a requirements file while using the system environment I get this error.

18 comments
Comment actions Permalink

Something weird with the environment I think. Please try creating a new virtualenv from the terminal using the same interpreter.

https://virtualenv.pypa.io/en/latest/

Does it work?

-1
Comment actions Permalink

I have the exact same issue. Been using PyCharm for years.... first time I ran into this one. 

1
Comment actions Permalink

Andrey Resler, I agree and not sure whats going on with it.  However if I manually set one up like you said, I feel like I am a step closer to a fix...

Python Version: 3.8.1

PIP Version: 19.2.3 (I'm on windows 10 and anytime I upgrade to 19.3.1 it bricks pip and its not functional)

 

Steps Taken:

pip install virtualenv
Use this if you have to install via a specific user account
pip install --user virtualenv
cd /path/to/project
virtualenv venv

After that it created a venv folder with my environment contents

Went into the settings > Cogwheel > Add > Existing environment > OK

I then ran into a error about setup tools so I ran the following to downgrade

pip install setuptools==40.8.0

Ran the activate script

\path\to\env\Scripts\activate

And now my venv doesn't know what pip is...

even though its in the environment

Any idea why this would be happening?

0
Comment actions Permalink

Sorry, can't say anything specific at the moment, but it doesn't look like IDE-related issue. Also I don't have any issues with updating pip or setuptools to the latest version on Windows 10

I would try re-installing python from www.python.org and checking my PATH variable.

0
Comment actions Permalink

Same exact issue. What's going on? any fixes?

0
Comment actions Permalink

Raga I was able to get this fixed on my computer but I'm not sure if what I did is going to be a fix for you.  I went on a uninstall spree through multiple applications just to check if they were interfering with the access given to Pycharm.  My company has a specific anti-virus/firewall installed on each of our computers and when I uninstalled that service everything started to work again.  From what I can tell it wasn't allowing Pycharm to access my user folder where python and my projects were stored and Pycharm being installed on the root in Program Files.  I thought running Pycharm as an Administrator would fix this but that was not the case.

1
Comment actions Permalink

I did the same uninstall spree. I uninstalled python 3.8.5 and reinstalled it on my local drive. I uninstalled PyCharm twice. I'm still getting the same errors.

I've lost three whole days on this BS.

0
Comment actions Permalink

Jordan,

I took your hint and on my last re-install, I disabled my firewall and it seems to be working. It's off-the shelf internet security software, so I am surprised that something that common can lead to such problems and hasn't been addressed.

Thanks

0
Comment actions Permalink

Roga,

What exactly did you re-install with disabled firewall: Python or PyCharm? I tried to disable it too but looks like it doesn't work for my case. Have you guys got any ideas what should I do more?

0
Comment actions Permalink

Raga Glad to hear you got it to work and I agree it's a bit odd that it's blocking the setup even when ran in Administrator.  When I talked with my IT team, they stated that it could be something with Pycharm having to modify system files and the security software is seeing that as a threat so it throws that process in a sandbox environment which in the end not allowing it to run.

 

Lol Yep it is Comodo, we've had so many issues with it sandboxing or not allowing other services to run so I have the same feelings towards this anti-virus program.  And after a few months of testing, I still have not been able to have it installed and run Pycharm properly.

0
Comment actions Permalink

I can't convince Pycharm to use any virtualenv environment and I'm not running any sort of antivirus.

0
Comment actions Permalink

Have you tried creating a virtualenv from the system terminal using the same interpreter? Does it work?

0
Comment actions Permalink

I got "Failed to create interpreter" without the "venv\bin\python not found" part on Ubuntu 20.04.2 LTS. 

​sudo apt install python3-pip
pip3 install virtualenv

Solved that for me. 

3
Comment actions Permalink

I hit this all the time, and it's quite painful - like others, this consumes days.

For my own machine, I have found that the only way to avoid this issue is

  1. Never to create venv's outside PyCharm
  2. Use PyCharm do it using the requirements.txt. 

This makes procedures PyCharm-specific, as doc'd here:

https://github.com/valhuber/ApiLogicServer/wiki/Quick-Start#project-execution

This worked for me, hope it saves others some time.

 

0
Comment actions Permalink

I have this problem too on Mac.

And maybe this is a Python or pip ENV problem. I solved this by reinstall Python. (Before, I installed python 3.10 use home brew. Then I uninstalled that and downloaded the package from Python.org, after reinstallation this problem is gone.)

0
Comment actions Permalink

I had this same problem today, and found a solution.  I'm using a Mac, and was trying to base my virtualenv on a homebrew installed python@3.10.  For reasons I won't get into, I removed all of homebrew and started from scratch.  This time I never installed python@3.10 using homebrew, but pyenv instead.  After setting up pyenv, I used it to install python 3.10.2, and used this path (/Users/myhomedir/.pyenv/versions/3.10.2/bin/python) for the virtualenv source.  It finally worked perfectly, and makes it easier to install multiple versions of python.

0
Comment actions Permalink

I got the "failed to create interpreter" problem today after installing Ubuntu 22.04, and i managed to solve it by installing pip:

sudo apt install python3-pip
1
Comment actions Permalink

Hi ,

running Ubuntu 22.04 LTS in vmware
python version 3.10.4

Using PyCharm 2022.1.1 (Professional Edition) and also got the error
"Directory /home/janrum/PycharmProjects/vision_install/venv/bin/python not found".
when creating the virtual environment via the PyCharm IDE.

I tried to create it via terminal and got an error:

The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.
apt install python3.10-venv

I ran the command on my terminal: sudo apt install python3.10-venv

I restarted Pycharm and could create the virtual environement without any problems.

Cheers, Jan.

 

0

Please sign in to leave a comment.