Skip to content

Pythonfinder should support the windows py command #5779

@taronaldinho

Description

@taronaldinho

Since upgrading pipenv to v2023.5.19, it does not successfully recognize the version of Python installed on my PC.
It fails as follows.

PS > py -m pipenv --python 3.9
Warning: Python 3.9 was not found on your system...
Neither 'pyenv' nor 'asdf' could be found to install Python.
You can specify specific versions of Python with:
$ pipenv --python path\to\python

The path to each version of Python installed on the PC can be found from the py command.
(I have not added the Python PATH according to the default installer settings.)

PS > py --list-paths
 -V:3.11 *        [USERPROFILE]\AppData\Local\Programs\Python\Python311\python.exe
 -V:3.10          [USERPROFILE]\AppData\Local\Programs\Python\Python310\python.exe
 -V:3.9           [USERPROFILE]\AppData\Local\Programs\Python\Python39\python.exe
 -V:3.8           [USERPROFILE]\AppData\Local\Programs\Python\Python38\python.exe
 -V:3.7           [USERPROFILE]\AppData\Local\Programs\Python\Python37\python.exe

Therefore, as indicated in the error message, the virtual environment can be successfully created by specifying the Python path to be used.

> py -m pipenv --python [USERPROFILE]\AppData\Local\Programs\Python\Python39\python.exe
-> It's OK.

However, by simply downgrading pipenv to v2023.4.29, the above command succeeds as before.

PS > py -m pip install -U pipenv==2023.4.29

...

Successfully installed pipenv-2023.4.29

PS > py -m pipenv --python 3.9
Creating a virtualenv for this project...

...

Successfully created virtual environment!
Virtualenv location: [VENV PATH]
Creating a Pipfile for this project...

The same problem occurred on three PCs (Windows 10 and 11).
Are there any steps that should be changed to enable the creation of virtual environments with py -m pipenv --python commands without specifying the full path of Python?


$ pipenv --support

Pipenv version: '2023.7.3'

Pipenv location: '[USERPROFILE]\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\pipenv'

Python location: '[USERPROFILE]\\AppData\\Local\\Programs\\Python\\Python311\\python.exe'

OS Name: 'nt'

User pip version: '23.1.2'

user Python installations found:

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.11.3',
 'os_name': 'nt',
 'platform_machine': 'AMD64',
 'platform_python_implementation': 'CPython',
 'platform_release': '10',
 'platform_system': 'Windows',
 'platform_version': '10.0.19045',
 'python_full_version': '3.11.3',
 'python_version': '3.11',
 'sys_platform': 'win32'}

System environment variables:

  • ALLUSERSPROFILE
  • APPDATA
  • COMMONPROGRAMFILES
  • COMMONPROGRAMFILES(X86)
  • COMMONPROGRAMW6432
  • COMPUTERNAME
  • COMSPEC
  • CUDA_PATH
  • CUDA_PATH_V11_8
  • DRIVERDATA
  • HOMEDRIVE
  • HOMEPATH
  • LIB
  • LOCALAPPDATA
  • LOGONSERVER
  • MEFTLOGROOT
  • MMM_COM_SLACK_API_TOKEN
  • NUMBER_OF_PROCESSORS
  • NVTOOLSEXT_PATH
  • ONEDRIVE
  • OS
  • PATH
  • PATHEXT
  • PIPENV_VENV_IN_PROJECT
  • PROCESSOR_ARCHITECTURE
  • PROCESSOR_IDENTIFIER
  • PROCESSOR_LEVEL
  • PROCESSOR_REVISION
  • PROGRAMDATA
  • PROGRAMFILES
  • PROGRAMFILES(X86)
  • PROGRAMW6432
  • PSMODULEPATH
  • PUBLIC
  • SYSTEMDRIVE
  • SYSTEMROOT
  • TEMP
  • TMP
  • USERDNSDOMAIN
  • USERDOMAIN
  • USERDOMAIN_ROAMINGPROFILE
  • USERNAME
  • USERPROFILE
  • WINDIR
  • WSLENV
  • WT_PROFILE_ID
  • WT_SESSION
  • ZES_ENABLE_SYSMAN
  • PYTHONDONTWRITEBYTECODE
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

  • PIPENV_VENV_IN_PROJECT: true

Debug–specific environment variables:

  • PATH: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\libnvvp;C:\oracle\11gr2\prones\bin;C:\Program Files (x86)\NetCOBOL\;C:\Program Files (x86)\Common Files\Fujitsu\MeFt\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\NVIDIA Corporation\Nsight Compute 2022.3.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;[USERPROFILE]\.cargo\bin;[USERPROFILE]\AppData\Local\Microsoft\WindowsApps;[USERPROFILE]\AppData\Local\Programs\Microsoft VS Code\bin;[USERPROFILE]\.dotnet\tools;[USERPROFILE]\AppData\Roaming\npm;[USERPROFILE]\.dotnet\tools

Metadata

Metadata

Assignees

No one assigned

    Labels

    Contributor CandidateThe issue has been identified/triaged and contributions are welcomed/encouraged.OS: WindowsThis issue affects the Windows Operating System.Type: Documentation 📖This issue relates to documentation of pipenv.Type: Enhancement 💡This is a feature or enhancement request.Type: RegressionThis issue is a regression of a previous behavior.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions