Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create a virtual env with python 2.7 on windows #1796

Closed
stilren opened this issue Apr 29, 2020 · 2 comments · Fixed by #1797
Closed

Cannot create a virtual env with python 2.7 on windows #1796

stilren opened this issue Apr 29, 2020 · 2 comments · Fixed by #1797

Comments

@stilren
Copy link

stilren commented Apr 29, 2020

Issue

When creating a virtual environment using python 2.7 it fails with the message:
RuntimeError: failed to find interpreter for Builtin discover of python_spec='python2.7'

I have python 2.7, 3.7 and 3.8 installed. I can create environments for 3.7 and 3.8

Environment

Provide at least:
OS: Windows

awscli                              1.18.16                                                                             boto3                               1.12.16                                                                             botocore                            1.15.16                                                                             cattrs                              1.0.0                                                                               cdk-watchful                        0.4.6                                                                               certifi                             2020.4.5.1                                                                          chardet                             3.0.4                                                                               colorama                            0.4.3                                                                               constructs                          2.0.1                                                                               distlib                             0.3.0                                                                               docutils                            0.15.2                                                                              filelock                            3.0.12                                                                              idna                                2.9                                                                                 importlib-metadata                  1.6.0                                                                               importlib-resources                 1.4.0                                                                               jmespath                            0.9.5                                                                               jsii                                1.1.1                                                                               pip                                 19.2.3                                                                              publication                         0.0.3                                                                               pyasn1                              0.4.8                                                                               python-dateutil                     2.8.1                                                                               PyYAML                              5.3.1                                                                               requests                            2.23.0                                                                              rsa                                 3.4.2                                                                               s3transfer                          0.3.3                                                                               setuptools                          41.2.0                                                                              six                                 1.14.0                                                                              typing-extensions                   3.7.4.2                                                                             urllib3                             1.25.9                                                                              virtualenv                          20.0.18                                                                             virtualenvwrapper-win               1.2.6                                                                               zipp                                3.1.0   

Output of the virtual environment creation

Make sure to run the creation with -vvv --with-traceback:

PS C:\Users\WSEB\work> virtualenv --python=python2.7 test27 -vvv
61 setup logging to NOTSET [DEBUG report:43]
75 find interpreter for spec PythonSpec(implementation=CPython, major=2, minor=7) [INFO builtin:44]
76 proposed PythonInfo(spec=CPython3.8.2.final.0-64, exe=c:\python38\python.exe, platform=win32, version='3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)]', encoding_fs_io=utf-8-utf-8) [INFO builtin:50]
78 discover PATH[0]=C:\Python38\Scripts\ [DEBUG builtin:84]
79 filesystem is not case-sensitive [DEBUG info:28]
79 discover PATH[1]=C:\Python38\ [DEBUG builtin:84]
80 discover PATH[2]=C:\Program Files\AdoptOpenJDK\jre-11.0.3.2-openj9\bin [DEBUG builtin:84]
81 discover PATH[3]=C:\WINDOWS\system32 [DEBUG builtin:84]
81 discover PATH[4]=C:\WINDOWS [DEBUG builtin:84]
82 discover PATH[5]=C:\WINDOWS\System32\Wbem [DEBUG builtin:84]
82 discover PATH[6]=C:\WINDOWS\System32\WindowsPowerShell\v1.0\ [DEBUG builtin:84]
82 discover PATH[7]=C:\WINDOWS\System32\OpenSSH\ [DEBUG builtin:84]
83 discover PATH[8]=C:\Program Files\Git\cmd [DEBUG builtin:84]
83 discover PATH[9]=C:\Program Files\nodejs\ [DEBUG builtin:84]
84 discover PATH[10]=C:\ProgramData\chocolatey\bin [DEBUG builtin:84]
84 discover PATH[11]=C:\Program Files\Amazon\AWSCLIV2\ [DEBUG builtin:84]
85 discover PATH[12]=C:\HashiCorp\Vagrant\bin [DEBUG builtin:84]
85 discover PATH[13]=C:\Users\WSEB\AppData\Local\Microsoft\WindowsApps [DEBUG builtin:84]
86 Attempting to acquire lock 1578932602960 on C:\Users\WSEB\AppData\Local\pypa\virtualenv\py_info\20.0.18\4e341a9637e8fd2ad6729b2fad2f450d3cd7f3301af1e9c20e7237b10809c2b7.lock [DEBUG filelock:270]
86 Lock 1578932602960 acquired on C:\Users\WSEB\AppData\Local\pypa\virtualenv\py_info\20.0.18\4e341a9637e8fd2ad6729b2fad2f450d3cd7f3301af1e9c20e7237b10809c2b7.lock [INFO filelock:274]
87 get PythonInfo from C:\Users\WSEB\AppData\Local\pypa\virtualenv\py_info\20.0.18\4e341a9637e8fd2ad6729b2fad2f450d3cd7f3301af1e9c20e7237b10809c2b7.json for C:\Users\WSEB\AppData\Local\Microsoft\WindowsApps\python.exe [DEBUG cached_py_info:79]
87 Attempting to release lock 1578932602960 on C:\Users\WSEB\AppData\Local\pypa\virtualenv\py_info\20.0.18\4e341a9637e8fd2ad6729b2fad2f450d3cd7f3301af1e9c20e7237b10809c2b7.lock [DEBUG filelock:315]
88 Lock 1578932602960 released on C:\Users\WSEB\AppData\Local\pypa\virtualenv\py_info\20.0.18\4e341a9637e8fd2ad6729b2fad2f450d3cd7f3301af1e9c20e7237b10809c2b7.lock [INFO filelock:318]
89 Attempting to acquire lock 1578932602192 on C:\Users\WSEB\AppData\Local\pypa\virtualenv\py_info\20.0.18\2038186569936074e374468d4bbe2904a13496a41ed7a70129cfb883acf0ea5f.lock [DEBUG filelock:270]
89 Lock 1578932602192 acquired on C:\Users\WSEB\AppData\Local\pypa\virtualenv\py_info\20.0.18\2038186569936074e374468d4bbe2904a13496a41ed7a70129cfb883acf0ea5f.lock [INFO filelock:274]
90 get PythonInfo from C:\Users\WSEB\AppData\Local\pypa\virtualenv\py_info\20.0.18\2038186569936074e374468d4bbe2904a13496a41ed7a70129cfb883acf0ea5f.json for C:\Users\WSEB\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe [DEBUG cached_py_info:79]
90 Attempting to release lock 1578932602192 on C:\Users\WSEB\AppData\Local\pypa\virtualenv\py_info\20.0.18\2038186569936074e374468d4bbe2904a13496a41ed7a70129cfb883acf0ea5f.lock [DEBUG filelock:315]
90 Lock 1578932602192 released on C:\Users\WSEB\AppData\Local\pypa\virtualenv\py_info\20.0.18\2038186569936074e374468d4bbe2904a13496a41ed7a70129cfb883acf0ea5f.lock [INFO filelock:318]
91 proposed PathPythonInfo(spec=CPython3.7.7.final.0-64, system=C:\Users\WSEB\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe, exe=C:\Users\WSEB\AppData\Local\Microsoft\WindowsApps\python.exe, platform=win32, version='3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 11:52:54) [MSC v.1900 64 bit (AMD64)]', encoding_fs_io=utf-8-cp1252) [INFO builtin:50]
91 discover PATH[14]=C:\Program Files\JetBrains\PyCharm 2020.1\bin [DEBUG builtin:84]
93 discover PATH[15]=C:\Users\WSEB\AppData\Local\hyper\app-3.0.2\resources\bin [DEBUG builtin:84]
96 discover PATH[16]=C:\Users\WSEB\AppData\Local\Programs\Microsoft VS Code\bin [DEBUG builtin:84]
97 discover PATH[17]=C:\Users\WSEB\AppData\Roaming\npm [DEBUG builtin:84]
98 discover PATH[18]=C:\Program Files\Oracle\VirtualBox [DEBUG builtin:84]
99 RuntimeError: failed to find interpreter for Builtin discover of python_spec='python2.7' [ERROR __main__:57]
@stilren stilren added the bug label Apr 29, 2020
@gaborbernat
Copy link
Contributor

How did you install python 2.7, seems it's not available in either the registry or on the PATH 🤔

@gaborbernat
Copy link
Contributor

Hello, this now has been released via https://pypi.org/project/virtualenv/20.0.19/

heads up

@pypa pypa locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants