pipenv: pipenv works with --python 3.9 fails with 3.10 (error message like #5109)

Issue description

When creating vrt. env. with pipenv and python 3.9 it works but fails if python3.10 is used. The mesages seemed to be the same than #5109 but the workaround provided does not work on my debian :

pipenv --python 3.9
Creating a virtualenv for this project...
Pipfile: /home/********/Jupyter/VenvJupyter/Pipfile
Using /usr/bin/python3.9 (3.9.12) to create virtualenv...
⠹ Creating virtual environment...created virtual environment CPython3.9.12.final.0-64 in 523ms
  creator CPython3Posix(dest=/home/*****/.local/share/virtualenvs/VenvJupyter-tRdDfvhR, clear=False, no_vcs_ignore=False, global=False)                                        
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/*****/.local/share/virtualenv)                                  
    added seed packages: pip==22.0.4, setuptools==62.1.0, wheel==0.37.1                                                                                                        
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator                                                                  
                                                                                                                                                                               
✔ Successfully created virtual environment! 
Virtualenv location: /home/********/.local/share/virtualenvs/VenvJupyter-tRdDfvhR
Creating a Pipfile for this project...

Expected result

Expected same behavior with python3.9 and python3.10

Actual result

When creating vrt. env. with pipenv and python 3.10 it fails (Pipfile nor created and bin folder in subfolder local instead of the venv root folder) :

pipenv --python 3.10
Creating a virtualenv for this project...
Pipfile: /home/*******/Jupyter/VenvJupyter/Pipfile
Using /usr/bin/python3 (3.10.4) to create virtualenv...
⠧ Creating virtual environment...created virtual environment CPython3.10.4.final.0-64 in 132ms
  creator CPython3Posix(dest=/home/********/.local/share/virtualenvs/VenvJupyter-tRdDfvhR, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/********/.local/share/virtualenv)
    added seed packages: pip==22.0.4, setuptools==62.1.0, wheel==0.37.1
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

✔ Successfully created virtual environment! 
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.10/dist-packages/pipenv/vendor/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/pipenv/cli/options.py", line 56, in main
    return super().main(*args, **kwargs, windows_expand_args=False)
  File "/usr/local/lib/python3.10/dist-packages/pipenv/vendor/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/dist-packages/pipenv/vendor/click/core.py", line 1637, in invoke
    super().invoke(ctx)
  File "/usr/local/lib/python3.10/dist-packages/pipenv/vendor/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/dist-packages/pipenv/vendor/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/pipenv/vendor/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/pipenv/vendor/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/pipenv/cli/command.py", line 193, in cli
    ensure_project(
  File "/usr/local/lib/python3.10/dist-packages/pipenv/core.py", line 553, in ensure_project
    ensure_virtualenv(
  File "/usr/local/lib/python3.10/dist-packages/pipenv/core.py", line 486, in ensure_virtualenv
    do_create_virtualenv(                                                                                                                                                      
  File "/usr/local/lib/python3.10/dist-packages/pipenv/core.py", line 1013, in do_create_virtualenv                                                                            
    project._environment = Environment(                                                                                                                                        
  File "/usr/local/lib/python3.10/dist-packages/pipenv/environment.py", line 70, in __init__                                                                                   
    self._base_paths = self.get_paths()                                                                                                                                        
  File "/usr/local/lib/python3.10/dist-packages/pipenv/environment.py", line 394, in get_paths                                                                                 
    c = subprocess_run(command)                                                                                                                                                
  File "/usr/local/lib/python3.10/dist-packages/pipenv/utils/processes.py", line 75, in subprocess_run                                                                         
    return subprocess.run(                                                                                                                                                     
  File "/usr/lib/python3.10/subprocess.py", line 501, in run                                                                                                                   
    with Popen(*popenargs, **kwargs) as process:                                                                                                                               
  File "/usr/lib/python3.10/subprocess.py", line 966, in __init__                                                                                                              
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1842, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/home/********/.local/share/virtualenvs/VenvJupyter-tRdDfvhR/bin/python'

Steps to replicate

cd in empty folder pipenv --python 3.10 or pipenv --python 3.9


$ pipenv --support

Pipenv version: '2022.5.2'

Pipenv location: '/usr/local/lib/python3.10/dist-packages/pipenv'

Python location: '/usr/bin/python3'

Python installations found:

  • 3.10.4: /usr/bin/python3
  • 3.10.4: /bin/python3
  • 3.9.12: /usr/bin/python3.9
  • 3.9.12: /bin/python3.9

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.10.4',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.17.0-1-amd64',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP PREEMPT Debian 5.17.3-1 (2022-04-18)',
 'python_full_version': '3.10.4',
 'python_version': '3.10',
 'sys_platform': 'linux'}

System environment variables:

  • SHELL
  • SESSION_MANAGER
  • WINDOWID
  • QT_ACCESSIBILITY
  • COLORTERM
  • SSH_AGENT_LAUNCHER
  • XDG_MENU_PREFIX
  • GNOME_DESKTOP_SESSION_ID
  • GTK_IM_MODULE
  • LANGUAGE
  • SSH_AUTH_SOCK
  • XMODIFIERS
  • DESKTOP_SESSION
  • XML_CATALOG_FILES
  • GTK_MODULES
  • PWD
  • XDG_SESSION_DESKTOP
  • LOGNAME
  • XDG_SESSION_TYPE
  • SYSTEMD_EXEC_PID
  • XAUTHORITY
  • GJS_DEBUG_TOPICS
  • GDM_LANG
  • HOME
  • USERNAME
  • IM_CONFIG_PHASE
  • LANG
  • LS_COLORS
  • XDG_CURRENT_DESKTOP
  • WAYLAND_DISPLAY
  • INVOCATION_ID
  • MANAGERPID
  • CLUTTER_IM_MODULE
  • GJS_DEBUG_OUTPUT
  • NVM_DIR
  • GNOME_SETUP_DISPLAY
  • SGML_CATALOG_FILES
  • XDG_SESSION_CLASS
  • TERM
  • USER
  • COLORFGBG
  • DISPLAY
  • SHLVL
  • QT_IM_MODULE
  • CLASSPATH
  • XDG_RUNTIME_DIR
  • JOURNAL_STREAM
  • XDG_DATA_DIRS
  • PATH
  • GDMSESSION
  • DBUS_SESSION_BUS_ADDRESS
  • GIO_LAUNCHED_DESKTOP_FILE_PID
  • GIO_LAUNCHED_DESKTOP_FILE
  • OLDPWD
  • _
  • 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: /home/********/e-Book/DocbookXSLT/XSLT10/docbook-xsl-snapshot/tools/bin:/home/********/.local/bin:/home/********/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin:/usr/lib/ccache
  • SHELL: /bin/bash
  • LANG: fr_FR.UTF-8
  • PWD: /home/********/Jupyter/VenvJupyter

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 25 (9 by maintainers)

Most upvoted comments

You seem to have fixed the bug. Didn’t run into any issues while installing 3.9 or 3.10 👍

@maximlomans I am currently at this moment working on a PR (unrelated to your comment) that would rely on the vendor’d version of pip inside pipenv for installs – currently pipenv references outside of itself for pip for installs which causes this issue. I believe my PR when its available will resolve this going forward, so I re-opened this issue to tag my work against.

Edit: though re-reading your stack trace I am less convinced that its what I say it is 😃

Thanks @MrEvilOnGitHub that is great to hear – just want to call out that It was brilliantly understood and fixed by @torsava – I only pushed the release out.