RuntimeError: failed to find interpreter for Builtin discover of python_spec='ackages.venvs/lpthw'

I was following “A Project Skeleton”. and this error occurred. So why this problem and how to solve?

C:>pip install virtualenv
Collecting virtualenv
Downloading virtualenv-20.0.35-py2.py3-none-any.whl (4.9 MB)
|████████████████████████████████| 4.9 MB 504 kB/s
Collecting distlib<1,>=0.3.1
Downloading distlib-0.3.1-py2.py3-none-any.whl (335 kB)
|████████████████████████████████| 335 kB 6.4 MB/s
Collecting filelock<4,>=3.0.0
Downloading filelock-3.0.12-py3-none-any.whl (7.6 kB)
Collecting appdirs<2,>=1.4.3
Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting six<2,>=1.9.0
Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Installing collected packages: distlib, filelock, appdirs, six, virtualenv
Successfully installed appdirs-1.4.4 distlib-0.3.1 filelock-3.0.12 six-1.15.0 virtualenv-20.0.35

C:>mkdir . venvs
Access is denied.
Error occurred while processing: …

C:>mkdir.venvs

C:>mkdir.venvs
A subdirectory or file .venvs already exists.

C:>virtualenv -system-site -packages.venvs/lpthw
RuntimeError: failed to find interpreter for Builtin discover of python_spec=‘ackages.venvs/lpthw’

C:>virtualenv-system-site-packages.venvs/lpthw
‘virtualenv-system-site-packages.venvs’ is not recognized as an internal or external command,
operable program or batch file.

C:>mkdir.venvs
A subdirectory or file .venvs already exists.

C:>virtualenv -system-site -packages.venvs/lpthw
RuntimeError: failed to find interpreter for Builtin discover of python_spec=‘ackages.venvs/lpthw’

C:>mkdir.venvs
A subdirectory or file .venvs already exists.

C:>mkdir.venvs
A subdirectory or file .venvs already exists.

C:>mkdir.venvs

C:>virtualenv -system-site -packages.venvs/lpthw
RuntimeError: failed to find interpreter for Builtin discover of python_spec=‘ackages.venvs/lpthw’

C:>

Hello @yoonly and welcome to the forum.

Your installation of virtual enviornment was ok.
But then it seems that you tried to create a venv folder with mkdir.
That is not the way to create a venv.
I do not have Microsoft. So I had to google a little and found this:

Create a virtual environment

  1. Open your terminal and, inside your HelloWorld project folder, use the following command to create a virtual environment named venv :

python3 -m venv venv

  1. To activate the virtual environment , enter:

source venv /bin/activate

This actually works in linux. So if it does not work in Microsoft you have to google what difference there is in the command.

If you want another name of your virtual enviornment you change the second venv to a name of your choise.
Example:

python3 -m venv my_first_venv

Then I think you are ready to go on with the exercise.

2 Likes

Yes, follow @ulfen69 's advice.
For the record, I believe what you were trying to do should actually work, you just need to be more careful with whitespace in your commands. You typed

virtualenv -system-site -packages.venvs/lpthw

but it must be

virtualenv -system-site-packages .venvs/lpthw
2 Likes

Thank you. it worked.
i just missed a whitespace and and double dash

config file C:\Users\meowl\AppData\Local\pypa\virtualenv\virtualenv.ini missing (change via env var VIRTUALENV_CONFIG_FILE)

C:>virtualenv --system-site-packages .venvs/lpthw
created virtual environment CPython3.8.5.final.0-32 in 4184ms
creator CPython3Windows(dest=C:.venvs\lpthw, clear=False, global=True)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\meowl\AppData\Local\pypa\virtualenv)
added seed packages: pip==20.2.3, setuptools==50.3.1, wheel==0.35.1
activators BashActivator,BatchActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

C:>venvs\lpthw\Scripts\activate
The system cannot find the path specified.

C:>..venvs\lpthw\Scripts\activate

(lpthw) C:>pip install nose
Collecting nose
Downloading nose-1.3.7-py3-none-any.whl (154 kB)
|████████████████████████████████| 154 kB 595 kB/s
Installing collected packages: nose
Successfully installed nose-1.3.7

(lpthw) C:>

So I think people helped you here but I’ll point out the mistake your making for the future. Take a look at what you typed:

Access is denied.
Error occurred while processing: …

C:>mkdir.venvs

C:>mkdir.venvs

I type this:

mkdir .venvs

See the difference? It looks like you aren’t hitting space between each word. Now I think that’s either because you can’t see the spaces in the book, or your paste didn’t include them, but either way go check that you don’t do this frequently. I see you did it here too:

virtualenv -system-site -packages.venvs/lpthw

You just seem to not hit space when you should, and it looks like any time you see a . (dot) character.

That sound right?