question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pipenv uses arbitrary python installation on windows

See original GitHub issue

Similar to #4952, but happens on a clean pyenv install and while creating an environment. I’m using Python 3.10.4 installed with scoop. This happens both in cmd and in a bash shell.

Issue description

I installed pipenv using the python installation in my path, but when I run pipenv --support it only manages to find my python 2.7 installation, and an python 3.6.5 installation that came with an old julia installation, neither of which are in path. Attempting to create a new pipenv automatically uses the 3.6.5 installation.

Expected result

Pipenv uses the first python found in path

Actual result

Pipenv uses an arbitrary python installation I have no idea how it finds.

Steps to replicate

  1. Create a directory named “test” on the C drive
  2. Run python -m pip uninstall pipenv then python -m pip install pipenv
  3. Run pipenv --support

C:\test>where python
C:\Users\ITR\scoop\apps\python\current\python.exe
$ pipenv --support

Pipenv version: '2022.7.24'

Pipenv location: 'C:\\Users\\ITR\\scoop\\apps\\python\\current\\lib\\site-packages\\pipenv'

Python location: 'C:\\Users\\ITR\\scoop\\apps\\python\\current\\python.exe'

Python installations found:

  • 3.6.5: C:\Users\ITR\.julia\conda\3\python.exe
  • 2.7.18: C:\Users\ITR\scoop\apps\python27\current\python.exe

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.10.4',
 'os_name': 'nt',
 'platform_machine': 'AMD64',
 'platform_python_implementation': 'CPython',
 'platform_release': '10',
 'platform_system': 'Windows',
 'platform_version': '10.0.19044',
 'python_full_version': '3.10.4',
 'python_version': '3.10',
 'sys_platform': 'win32'}

System environment variables:

  • ALLUSERSPROFILE
  • ANDROID_HOME
  • APPDATA
  • BEEFPATH
  • BESIEGE_GAME_ASSEMBLIES
  • BESIEGE_UNITY_ASSEMBLIES
  • CGO_CFLAGS_ALLOW
  • CGO_CXXFLAGS_ALLOW
  • CGO_LDFLAGS_ALLOW
  • CHOCOLATEYINSTALL
  • CHOCOLATEYLASTPATHUPDATE
  • CMAKE_PREFIX_PATH
  • CMDER_ROOT
  • COMMONPROGRAMFILES
  • COMMONPROGRAMFILES(X86)
  • COMMONPROGRAMW6432
  • COMPUTERNAME
  • COMSPEC
  • CONEMUDIR
  • CPATH
  • CUDA_PATH
  • CUDA_PATH_V10_1
  • CUDA_PATH_V10_2
  • DRIVERDATA
  • FORKGITINSTANCE
  • GEM_HOME
  • GEM_PATH
  • GIT_INSTALL_ROOT
  • GIT_SSH
  • GOPATH
  • GOROOT
  • GTK_BASEPATH
  • HOMEDRIVE
  • HOMEPATH
  • JAVA_HOME
  • LOCALAPPDATA
  • LOGONSERVER
  • NGINX_HOME
  • NODE_PATH
  • NUMBER_OF_PROCESSORS
  • NVCUDASAMPLES10_1_ROOT
  • NVCUDASAMPLES_ROOT
  • NVM_HOME
  • NVM_SYMLINK
  • NVTOOLSEXT_PATH
  • ONEDRIVE
  • OS
  • PATH
  • PATHEXT
  • PHP_INI_SCAN_DIR
  • PKG_CONFIG
  • PKG_CONFIG_PATH
  • PROCESSOR_ARCHITECTURE
  • PROCESSOR_IDENTIFIER
  • PROCESSOR_LEVEL
  • PROCESSOR_REVISION
  • PROGRAMDATA
  • PROGRAMFILES
  • PROGRAMFILES(X86)
  • PROGRAMW6432
  • PROGUARD_HOME
  • PROMPT
  • PSMODULEPATH
  • PUBLIC
  • PYENV
  • PYENV_HOME
  • PYENV_ROOT
  • SCROLLVIEW_PATH
  • SESSIONNAME
  • STEAMROOT
  • SYSTEMDRIVE
  • SYSTEMROOT
  • TEMP
  • TESSDATA_PREFIX
  • TMP
  • U2NETHS_PATH
  • U2NETP_PATH
  • U2NET_PATH
  • USERDOMAIN
  • USERDOMAIN_ROAMINGPROFILE
  • USERNAME
  • USERPROFILE
  • VS140COMNTOOLS
  • WINDIR
  • PIP_SHIMS_BASE_MODULE
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PIP_PYTHON_PATH
  • PYTHONDONTWRITEBYTECODE
  • PYTHONFINDER_IGNORE_UNSUPPORTED

PipenvΓÇôspecific environment variables:

DebugΓÇôspecific environment variables:

  • PATH: C:\Program Files\Common Files\Oracle\Java\javapath;D:\Program Files\Eclipse Adoptium\jdk-8.0.322.6-hotspot\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\libnvvp;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\libnvvp;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;D:\Go\GoPath\bin;D:\misc;D:\OpenFaceSwap;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\GtkSharp\2.12\bin;D:\Program Files\Microsoft Network Monitor 3\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;D:\Go\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.5.0\;C:\cuDNN\bin;D:\Program Files\javafx-sdk-14.0.1\bin;D:\Program Files\javafx-sdk-14.0.1\lib;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;D:\misc\swigwin-3.0.12;D:\Program Files\Calibre2\;C:\Program Files\dotnet\;C:\Users\ITR\scoop\apps\python\current\Scripts;C:\Users\ITR\scoop\apps\python\current;C:\Users\ITR\scoop\apps\nodejs\current\bin;C:\Users\ITR\scoop\apps\nodejs\current;C:\Users\ITR\.nimble\bin;C:\Users\ITR\scoop\apps\gpg\current\bin;C:\Users\ITR\scoop\apps\adopt8-hotspot\current\bin;C:\Users\ITR\scoop\apps\perl\current\perl\site\bin;C:\Users\ITR\scoop\apps\perl\current\perl\bin;C:\Users\ITR\scoop\apps\perl\current\c\bin;C:\Users\ITR\scoop\apps\flutter\current\bin\cache\dart-sdk\bin;C:\Users\ITR\scoop\apps\ruby\current\bin;C:\Users\ITR\scoop\apps\ruby\current\gems\bin;C:\Users\ITR\scoop\apps\oraclejdk\current\bin;C:\Users\ITR\scoop\apps\gcc\current\bin;C:\Users\ITR\scoop\apps\yarn\current\Yarn\bin;C:\Users\ITR\scoop\apps\yarn\current\global\node_modules\.bin;C:\Users\ITR\scoop\apps\python27\current\scripts;C:\Users\ITR\scoop\apps\flutter\current\bin\cache\dart-sdk;C:\Python64\Scripts\;C:\Python64\;C:\Users\ITR\scoop\apps\nvm\current\nodejs\nodejs;C:\Users\ITR\AppData\Local\Programs\Python\Python36-32\Scripts\;C:\Users\ITR\AppData\Local\Programs\Python\Python36-32\;C:\Users\ITR\AppData\Local\Programs\Python\Launcher\;C:\Users\ITR\scoop\apps\android-sdk\current\tools\bin;C:\Users\ITR\scoop\apps\nmap\current\bin;C:\Users\ITR\scoop\apps\openjdk\current\bin;C:\Users\ITR\scoop\shims;C:\Users\ITR\scoop\apps\sdl2-msvc-x64\current\lib;D:\Program Files\RingLang\ring\bin;C:\Users\ITR\go\bin;D:\Program Files\Beef Lang\bin;C:\Users\ITR\AppData\Local\Programs\Microsoft VS Code\bin;D:\Program Files (x86)\Nmap;C:\Users\ITR\.dotnet\tools;C:\Users\ITR\.dotnet\tools;C:\Users\ITR\.dotnet\tools;D:\User\AppData\Local\Programs\Hyper\resources\bin;C:\Users\ITR\.dotnet\tools;C:\Users\ITR\.pyenv\pyenv-win\\bin;C:\Users\ITR\.pyenv\pyenv-win\\shims;C:\Users\ITR\AppData\Roaming\Python\Python310\Scripts;

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ITR13commented, Sep 3, 2022

There’s still the issue of pipenv --support only listing 2 python installations, but for installation it now works, yes. It’s possible it stored which python executable I used after I forced it to use python 3.8 (I haven’t uninstalled and reinstalled since it’s working). Same behaviour on latest pipenv version.

I can close the issue since --support not listing the correct python installations is just a minor issue, unless you want me to keep it open for it.

0reactions
matteiuscommented, Aug 31, 2022

The newest version of pipenv is searching for python3 before python, this also helps in some cases. @ITR13 I noticed in your last reply that you said the issue kind of went away for you? Is there something actionable remaining that we should do related to this ticket?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced Usage of Pipenv - Python Packaging Authority
Pipenv allows you to open any Python module that is installed (including ones in your codebase), with the $ pipenv open command: $...
Read more >
Python versions, pyenv and pipenv - GitLab
This install python 3.7.5 in your home directory at ~/.pyenv/versions/3.7.5/ . Note that this python is installed in a secluded ...
Read more >
pipenv Documentation - Read the Docs
This tutorial walks you through installing and using Python packages. ... Running Pipenv as root or with sudo (or Admin on Windows) is...
Read more >
How to use Pyenv & Pipenv for Python virtual environments
Pyenv allows you to easily install different versions of python alongside each other on your system without conflicts. It is not supported on ......
Read more >
Can't create env with pipenv on Windows - Stack Overflow
You can specify the path to the python interpreter that you want to use using the --python flag. python -m pipenv install dash...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found