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

Failed to create virtual environment with ver 2022.11.11 #5477

Closed
wyslmt opened this issue Nov 17, 2022 · 22 comments · Fixed by #5518
Closed

Failed to create virtual environment with ver 2022.11.11 #5477

wyslmt opened this issue Nov 17, 2022 · 22 comments · Fixed by #5518
Labels

Comments

@wyslmt
Copy link

wyslmt commented Nov 17, 2022

Issue description

failed to create virtual environment with pipenv-2022.11.11, but success with pipenv-2020.11.15

Expected result

pipenv-2020.11.15 rsult:

❯ pipenv --python ~/.pyenv/versions/2.7.18/bin/python
Creating a virtualenv for this project...
Pipfile: /var/www/html/ai_algorithm/Pipfile
Using /home/admin/.pyenv/versions/2.7.18/bin/python (2.7.18) to create virtualenv...
⠋ Creating virtual environment...created virtual environment CPython2.7.18.final.0-64 in 766ms
  creator CPython2Posix(dest=/var/www/html/ai_algorithm/.venv, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, wheel=bundle, setuptools=bundle, via=copy, app_data_dir=/home/admin/.local/share/virtualenv)
    added seed packages: pip==20.3.3, setuptools==44.1.1, wheel==0.36.2
  activators PythonActivator,CShellActivator,FishActivator,PowerShellActivator,BashActivator

✔ Successfully created virtual environment! 
Virtualenv location: /var/www/html/ai_algorithm/.venv
Creating a Pipfile for this project...

Actual result

pipenv-2022.11.11 rsult:

pipenv --python /home/admin/.pyenv/versions/2.7.18/bin/python
Creating a virtualenv for this project...
Pipfile: /var/www/html/ai_algorithm/Pipfile
Using /home/admin/.pyenv/versions/2.7.18/bin/python (2.7.18) to create virtualenv...
⠹ Creating virtual environment...SystemExit: 2

✘ Failed creating virtual environment 
[pipenv.exceptions.VirtualenvCreationException]: usage: virtualenv [--version] [--with-traceback] [-v | -q] [--read-only-app-data] [--app-data APP_DATA] [--reset-app-data] [--upgrade-embed-wheels] [--discovery {builtin}] [-p py] [--try-first-with py_exe]
                  [--creator {builtin,cpython2-posix}] [--seeder {app-data,pip}] [--no-seed] [--activators comma_sep_list]
virtualenv: error: argument --creator: invalid choice: 'venv' (choose from 'builtin', 'cpython2-posix')

Failed to create virtual environment.

pipenv --support result

❯ pipenv --support

$ pipenv --support

Pipenv version: '2022.11.11'

Pipenv location: '/home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages/pipenv'

Python location: '/home/admin/.pyenv/versions/3.7.7/bin/python'

OS Name: 'posix'

User pip version: '22.3'

user Python installations found:

  • 3.8.10: /usr/bin/python
  • 3.8.10: /usr/bin/python3
  • 3.8.10: /usr/bin/python3.8
  • 3.8.3: /home/admin/.pyenv/versions/3.8.3/bin/python
  • 3.7.7: /home/admin/.pyenv/versions/3.7.7/bin/python
  • 3.7.7: /home/admin/.pyenv/versions/3.7.7/bin/python3
  • 3.7.7: /home/admin/.pyenv/versions/3.7.7/bin/python3.7
  • 3.7.7: /home/admin/.pyenv/versions/3.7.7/bin/python3.7m
  • 3.7.7: /home/admin/.pyenv/versions/3.7.7/bin/python
  • 3.7.4: /home/admin/.pyenv/versions/3.7.4/bin/python
  • 3.6.9: /home/admin/.pyenv/versions/3.6.9/bin/python
  • 3.6.9: /usr/bin/python3.6m
  • 3.6.9: /usr/bin/python3.6
  • 2.7.18: /home/admin/.pyenv/versions/2.7.18/bin/python2
  • 2.7.16: /home/admin/.pyenv/versions/2.7.16/bin/python2

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.7.7',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.15.57-051557-generic',
 'platform_system': 'Linux',
 'platform_version': '#202207231132 SMP Sat Jul 23 11:50:34 UTC 2022',
 'python_full_version': '3.7.7',
 'python_version': '3.7',
 'sys_platform': 'linux'}

System environment variables:

  • SHELL
  • LSCOLORS
  • PYENV_HOOK_PATH
  • PIPENV_VENV_IN_PROJECT
  • PYENV_SHELL
  • LESS
  • NVM_INC
  • _P9K_TTY
  • LC_ADDRESS
  • LC_NAME
  • P9K_TTY
  • LC_MONETARY
  • PYENV_VERSION
  • PWD
  • PYENV_VIRTUALENV_INIT
  • LOGNAME
  • XDG_SESSION_TYPE
  • MOTD_SHOWN
  • HOME
  • AUTOJUMP_ERROR_PATH
  • LC_PAPER
  • LANG
  • LS_COLORS
  • SSH_CONNECTION
  • PYENV_DIR
  • NVM_DIR
  • XDG_SESSION_CLASS
  • LC_IDENTIFICATION
  • TERM
  • ZSH
  • USER
  • AUTOJUMP_SOURCED
  • SHLVL
  • NVM_CD_FLAGS
  • PAGER
  • LC_TELEPHONE
  • LC_MEASUREMENT
  • XDG_SESSION_ID
  • XDG_RUNTIME_DIR
  • SSH_CLIENT
  • PYENV_ROOT
  • LC_TIME
  • P9K_SSH
  • PATH
  • DBUS_SESSION_BUS_ADDRESS
  • NVM_BIN
  • SSH_TTY
  • LC_NUMERIC
  • OLDPWD
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PIP_PYTHON_PATH
  • PYTHONDONTWRITEBYTECODE
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

  • PIPENV_VENV_IN_PROJECT: 1

Debug–specific environment variables:

  • PATH: /home/admin/.pyenv/versions/3.7.7/bin:/home/admin/.pyenv/libexec:/home/admin/.pyenv/plugins/python-build/bin:/home/admin/.pyenv/plugins/pyenv-virtualenv/bin:/home/admin/.pyenv/plugins/pyenv-update/bin:/home/admin/.pyenv/plugins/pyenv-installer/bin:/home/admin/.pyenv/plugins/pyenv-doctor/bin:/home/admin/.autojump/bin:/home/admin/.nvm/versions/node/v12.18.3/bin:/home/admin/.config/yarn/global/node_modules/.bin:/home/admin/Android/Sdk/platform-tools:/home/admin/.pyenv/plugins/pyenv-virtualenv/shims:/home/admin/.pyenv/shims:/home/admin/.pyenv/bin:/home/admin/.autojump/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  • SHELL: /bin/zsh
  • LANG: en_US.UTF-8
  • PWD: /var/www/html/ai_algorithm

@matteius
Copy link
Member

@wyslmt Can you try to to uninstall your virtualenv version (if it was apt, use apt to uninstall it) and then install virtualenv from pypi with pip install virtualenv, and try again?

@wyslmt
Copy link
Author

wyslmt commented Nov 18, 2022

apt virtualenv is not installed

❯ sudo apt purge python-virtualenv          
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'python-virtualenv' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.

and i've reinstall the virtualenv

❯ ~/.pyenv/versions/3.7.7/bin/python -m pip uninstall virtualenv
Uninstalling virtualenv-20.16.7:
  Would remove:
    /home/admin/.pyenv/versions/3.7.7/bin/virtualenv
    /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages/virtualenv-20.16.7.dist-info/*
    /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages/virtualenv/*
Proceed (y/n)? y
  Successfully uninstalled virtualenv-20.16.7
❯ ~/.pyenv/versions/3.7.7/bin/python -m pip install virtualenv 
Collecting virtualenv
  Using cached https://files.pythonhosted.org/packages/fd/76/c99d37939e17e3c53f1c1b7e4f5365a9160b1cd0b37700657eed9a2a6775/virtualenv-20.16.7-py3-none-any.whl
Requirement already satisfied: distlib<1,>=0.3.6 in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from virtualenv) (0.3.6)
Requirement already satisfied: importlib-metadata>=4.8.3; python_version < "3.8" in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from virtualenv) (5.0.0)
Requirement already satisfied: platformdirs<3,>=2.4 in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from virtualenv) (2.5.4)
Requirement already satisfied: filelock<4,>=3.4.1 in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from virtualenv) (3.8.0)
Requirement already satisfied: zipp>=0.5 in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from importlib-metadata>=4.8.3; python_version < "3.8"->virtualenv) (3.10.0)
Requirement already satisfied: typing-extensions>=3.6.4; python_version < "3.8" in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from importlib-metadata>=4.8.3; python_version < "3.8"->virtualenv) (4.4.0)
Installing collected packages: virtualenv
Successfully installed virtualenv-20.16.7

and the result is the same as above

@matteius
Copy link
Member

Ok interesting, thanks for checking.

@matteius matteius added triage Type: Bug 🐛 This issue is a bug. Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged. labels Nov 18, 2022
@matteius
Copy link
Member

Does it help if you sudo apt install python3-virtualenv ?

@wyslmt
Copy link
Author

wyslmt commented Nov 28, 2022

❯ sudo apt install python3-virtualenv                      
[sudo] password for admin: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  python3-appdirs python3-distlib python3-filelock python3-importlib-metadata python3-more-itertools python3-zipp
The following NEW packages will be installed:
  python3-appdirs python3-distlib python3-filelock python3-importlib-metadata python3-more-itertools python3-virtualenv python3-zipp
0 upgraded, 7 newly installed, 0 to remove and 98 not upgraded.
Need to get 252 kB of archives.
After this operation, 1,304 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 python3-appdirs all 1.4.3-2.1 [10.8 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 python3-distlib all 0.3.0-1 [116 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 python3-filelock all 3.0.12-2 [7,948 B]
Get:4 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 python3-more-itertools all 4.2.0-1build1 [39.4 kB]
Get:5 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 python3-zipp all 1.0.0-1 [5,312 B]
Get:6 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 python3-importlib-metadata all 1.5.0-1 [9,992 B]
Get:7 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 python3-virtualenv all 20.0.17-1ubuntu0.4 [62.7 kB]
Fetched 252 kB in 2s (150 kB/s)              
Selecting previously unselected package python3-appdirs.
(Reading database ... 287376 files and directories currently installed.)
Preparing to unpack .../0-python3-appdirs_1.4.3-2.1_all.deb ...
Unpacking python3-appdirs (1.4.3-2.1) ...
Selecting previously unselected package python3-distlib.
Preparing to unpack .../1-python3-distlib_0.3.0-1_all.deb ...
Unpacking python3-distlib (0.3.0-1) ...
Selecting previously unselected package python3-filelock.
Preparing to unpack .../2-python3-filelock_3.0.12-2_all.deb ...
Unpacking python3-filelock (3.0.12-2) ...
Selecting previously unselected package python3-more-itertools.
Preparing to unpack .../3-python3-more-itertools_4.2.0-1build1_all.deb ...
Unpacking python3-more-itertools (4.2.0-1build1) ...
Selecting previously unselected package python3-zipp.
Preparing to unpack .../4-python3-zipp_1.0.0-1_all.deb ...
Unpacking python3-zipp (1.0.0-1) ...
Selecting previously unselected package python3-importlib-metadata.
Preparing to unpack .../5-python3-importlib-metadata_1.5.0-1_all.deb ...
Unpacking python3-importlib-metadata (1.5.0-1) ...
Selecting previously unselected package python3-virtualenv.
Preparing to unpack .../6-python3-virtualenv_20.0.17-1ubuntu0.4_all.deb ...
Unpacking python3-virtualenv (20.0.17-1ubuntu0.4) ...
Setting up python3-more-itertools (4.2.0-1build1) ...
Setting up python3-filelock (3.0.12-2) ...
Setting up python3-distlib (0.3.0-1) ...
Setting up python3-zipp (1.0.0-1) ...
Setting up python3-appdirs (1.4.3-2.1) ...
Setting up python3-importlib-metadata (1.5.0-1) ...
Setting up python3-virtualenv (20.0.17-1ubuntu0.4) ...
Processing triggers for man-db (2.9.1-1) ...
❯ python -m pip install pipenv            
Collecting pipenv
  Downloading https://files.pythonhosted.org/packages/ee/4d/444a9b46c6a4d141238fc9c9cf2a57842b0f6c2cf1e5c2a705ef03e2edb9/pipenv-2022.11.25-py3-none-any.whl (2.9MB)
     |████████████████████████████████| 2.9MB 6.9MB/s 
Requirement already satisfied: certifi in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from pipenv) (2022.9.24)
Requirement already satisfied: virtualenv in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from pipenv) (20.16.7)
Requirement already satisfied: setuptools>=36.2.1 in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from pipenv) (41.2.0)
Requirement already satisfied: virtualenv-clone>=0.2.5 in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from pipenv) (0.5.7)
Requirement already satisfied: importlib-metadata>=4.8.3; python_version < "3.8" in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from virtualenv->pipenv) (5.0.0)
Requirement already satisfied: distlib<1,>=0.3.6 in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from virtualenv->pipenv) (0.3.6)
Requirement already satisfied: filelock<4,>=3.4.1 in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from virtualenv->pipenv) (3.8.0)
Requirement already satisfied: platformdirs<3,>=2.4 in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from virtualenv->pipenv) (2.5.4)
Requirement already satisfied: typing-extensions>=3.6.4; python_version < "3.8" in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from importlib-metadata>=4.8.3; python_version < "3.8"->virtualenv->pipenv) (4.4.0)
Requirement already satisfied: zipp>=0.5 in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from importlib-metadata>=4.8.3; python_version < "3.8"->virtualenv->pipenv) (3.10.0)
Installing collected packages: pipenv
Successfully installed pipenv-2022.11.25
WARNING: You are using pip version 19.2.3, however version 22.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
❯ pipenv --python /home/admin/.pyenv/versions/2.7.18/bin/python
Creating a virtualenv for this project...
Pipfile: /home/admin/Downloads/test/Pipfile
Using /home/admin/.pyenv/versions/2.7.18/bin/python (2.7.18) to create virtualenv...
⠙ Creating virtual environment...SystemExit: 2

✘ Failed creating virtual environment
[pipenv.exceptions.VirtualenvCreationException]: usage: virtualenv [--version] [--with-traceback] [-v | -q] [--read-only-app-data] [--app-data APP_DATA] [--reset-app-data] [--upgrade-embed-wheels] [--discovery {builtin}] [-p py] [--try-first-with py_exe]
                  [--creator {builtin,cpython2-posix}] [--seeder {app-data,pip}] [--no-seed] [--activators comma_sep_list]
virtualenv: error: argument --creator: invalid choice: 'venv' (choose from 'builtin', 'cpython2-posix')

Failed to create virtual environment.

It seems to have no effec

@matteius
Copy link
Member

matteius commented Dec 3, 2022

Ok, I think I know a way to improve this case for pipenv. What flavor of linux is this by the way @wyslmt ?

@matteius
Copy link
Member

matteius commented Dec 3, 2022

I've opened a PR @wyslmt but I don't have a great way to test it myself -- are you able to help verify the branch above is solving your issue?

@oz123
Copy link
Contributor

oz123 commented Dec 3, 2022

The issue is caused on debian und Ubuntu which split puthon3-venv outside of python. Installing it should solve it.
Never the less, the PR has a fix for it to.

@matteius
Copy link
Member

matteius commented Dec 3, 2022

Well I know for a fact in Ubuntu we have venv combined with Python.

@wyslmt
Copy link
Author

wyslmt commented Dec 5, 2022

Sorry for the late reply. Would you like me to test that branch? Is there a tutorial to test branch?

@matteius
Copy link
Member

matteius commented Dec 5, 2022

It's now in the main branch but unreleased. You can pip install a git branch, from my phone right now.

@wyslmt
Copy link
Author

wyslmt commented Dec 5, 2022

I have installed pipenv from main branch, but the version is 2022.11.1.dev0. Did I miss something?

❯ python -m pip install git+https://github.com/pypa/pipenv.git@main
Collecting git+https://github.com/pypa/pipenv.git@main
  Cloning https://github.com/pypa/pipenv.git (to revision main) to /tmp/pip-req-build-wp0cc5ak
  Running command git clone --filter=blob:none --quiet https://github.com/pypa/pipenv.git /tmp/pip-req-build-wp0cc5ak
  Resolved https://github.com/pypa/pipenv.git to commit 0a03b7660226252a0d3eba94231164d7346db92c
  Running command git submodule update --init --recursive -q
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: setuptools>=36.2.1 in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from pipenv==2022.11.1.dev0) (41.2.0)
Requirement already satisfied: virtualenv in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from pipenv==2022.11.1.dev0) (20.16.7)
Requirement already satisfied: certifi in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from pipenv==2022.11.1.dev0) (2022.9.24)
Requirement already satisfied: virtualenv-clone>=0.2.5 in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from pipenv==2022.11.1.dev0) (0.5.7)
Requirement already satisfied: importlib-metadata>=4.8.3 in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from virtualenv->pipenv==2022.11.1.dev0) (5.0.0)
Requirement already satisfied: platformdirs<3,>=2.4 in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from virtualenv->pipenv==2022.11.1.dev0) (2.5.4)
Requirement already satisfied: filelock<4,>=3.4.1 in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from virtualenv->pipenv==2022.11.1.dev0) (3.8.0)
Requirement already satisfied: distlib<1,>=0.3.6 in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from virtualenv->pipenv==2022.11.1.dev0) (0.3.6)
Requirement already satisfied: zipp>=0.5 in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from importlib-metadata>=4.8.3->virtualenv->pipenv==2022.11.1.dev0) (3.10.0)
Requirement already satisfied: typing-extensions>=3.6.4 in /home/admin/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from importlib-metadata>=4.8.3->virtualenv->pipenv==2022.11.1.dev0) (4.4.0)
Building wheels for collected packages: pipenv
  Building wheel for pipenv (pyproject.toml) ... done
  Created wheel for pipenv: filename=pipenv-2022.11.1.dev0-py3-none-any.whl size=2864104 sha256=9427e3579bc155dfd1070782e0c5c7fdd7ef969dbc61ace70eea59bb46961e59
  Stored in directory: /tmp/pip-ephem-wheel-cache-lrv5in83/wheels/14/9b/bf/8e8047280b9088c03a4e37c5fff63047871468a7e2783ee79c
Successfully built pipenv
Installing collected packages: pipenv
Successfully installed pipenv-2022.11.1.dev0

@matteius
Copy link
Member

matteius commented Dec 5, 2022

That is correct @wyslmt -- the dev tag was not updated from the last publish to pypi due to a conflict on main, but that looks like you installed the latest main trunk correctly.

@wyslmt
Copy link
Author

wyslmt commented Dec 5, 2022

So the fix should be included in the version which I install?

❯ pipenv --version                                                  
pipenv, version 2022.11.1.dev0
❯ pipenv --python /home/admin/.pyenv/versions/2.7.18/bin/python
Creating a virtualenv for this project...
Pipfile: /home/admin/Downloads/test/Pipfile
Using /home/admin/.pyenv/versions/2.7.18/bin/python (2.7.18) to create virtualenv...
⠙ Creating virtual environment...SystemExit: 2

✘ Failed creating virtual environment
[pipenv.exceptions.VirtualenvCreationException]: usage: virtualenv [--version] [--with-traceback] [-v | -q] [--read-only-app-data] [--app-data APP_DATA] [--reset-app-data] [--upgrade-embed-wheels] [--discovery {builtin}] [-p py] [--try-first-with py_exe]
                  [--creator {builtin,cpython2-posix}] [--seeder {app-data,pip}] [--no-seed] [--activators comma_sep_list]
virtualenv: error: argument --creator: invalid choice: 'venv' (choose from 'builtin', 'cpython2-posix')

Failed to create virtual environment.

@matteius
Copy link
Member

matteius commented Dec 5, 2022

@wyslmt so the fix tries to import venv, if its available it uses --creator=venv. Can you check if you launch python and check import venv -- is it available?

@wyslmt
Copy link
Author

wyslmt commented Dec 5, 2022

❯ python -V                                                           
Python 3.7.7

❯ cat test.py
import venv
print(venv)

❯ python test.py
<module 'venv' from '/home/admin/.pyenv/versions/3.7.7/lib/python3.7/venv/__init__.py'>

puthon3-venv is not installed. Is it necessary?

@oz123
Copy link
Contributor

oz123 commented Dec 5, 2022

Are you using EC2 linux? Which distro is it? Please post cat /etc/os-release

@matteius
Copy link
Member

matteius commented Dec 5, 2022

@wyslmt It is necessary on older versions of Ubuntu.

@wyslmt
Copy link
Author

wyslmt commented Dec 6, 2022

Are you using EC2 linux? Which distro is it? Please post cat /etc/os-release

It's a personal computer. Ubuntu 20.04 installed by myself.

❯ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

@oz123
Copy link
Contributor

oz123 commented Dec 6, 2022

I think the problem is that your default python is 2.7.18 which installed the binary python. Which is then matched as the first python that pythonfinder (which is used by pipenv) . This python does not have a venv in the STL.
This is inferred from the flags you passed.
To fix this use the pip which is installed inside python2 to install virtualenv
This should be something like:

/home/admin/.pyenv/versions/2.7.18/bin/pip install virtualenv

And then try:

pipenv --python /home/admin/.pyenv/versions/2.7.18/bin/python --creator virtualenv.

@oz123 oz123 added Python 2 and removed Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged. labels Dec 6, 2022
@matteius
Copy link
Member

matteius commented Dec 7, 2022

Which is then matched as the first python that pythonfinder (which is used by pipenv) . This python does not have a venv in the STL.

I thought we changed pythonfinder to look for python3 first.

@oz123
Copy link
Contributor

oz123 commented Dec 7, 2022

I thought so too, but it seems it's doing weird stuff sorting alphabetically:
builtin,cpython2-posix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants