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

virtualenv: error: argument --creator: invalid choice: 'venv' (choose from 'builtin', 'cpython2-posix') #5452

Closed
f0o opened this issue Nov 2, 2022 · 8 comments

Comments

@f0o
Copy link

f0o commented Nov 2, 2022

Issue description

pipenv check fails or actually everything fails; it does install the python version correctly however.

Expected result

it to work, obviously ;)

Actual result

/usr/local/py-utils/venvs/pipenv/lib/python3.11/site-packages/pipenv/vendor/attr/_make.py:876: RuntimeWarning: Running interpreter doesn't sufficiently support code object introspection.  Some features like bare super() or accessing __class__ will not work with slotted classes.
  set_closure_cell(cell, cls)
/usr/local/py-utils/venvs/pipenv/lib/python3.11/site-packages/pipenv/vendor/attr/_make.py:876: RuntimeWarning: Running interpreter doesn't sufficiently support code object introspection.  Some features like bare super() or accessing __class__ will not work with slotted classes.
  set_closure_cell(cell, cls)
/usr/local/py-utils/venvs/pipenv/lib/python3.11/site-packages/pipenv/vendor/attr/_make.py:876: RuntimeWarning: Running interpreter doesn't sufficiently support code object introspection.  Some features like bare super() or accessing __class__ will not work with slotted classes.
  set_closure_cell(cell, cls)
Creating a virtualenv for this project...
Pipfile: /workspaces/backend/Pipfile
Using /home/vscode/.pyenv/versions/2.7.18/bin/python2.7 (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.

When possible, provide the verbose output (--verbose), especially for locking and dependencies resolving issues.

Steps to replicate

Provide the steps to replicate (which usually at least includes the commands and the Pipfile).

Pipfile:

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

pipenv check already fails


@f0o
Copy link
Author

f0o commented Nov 2, 2022

https://pastebin.com/USh8htgX

due to size limitations here is the pipenv --support output

@matteius
Copy link
Member

matteius commented Nov 2, 2022

@f0o We don't have support for python 3.11 yet

@f0o
Copy link
Author

f0o commented Nov 2, 2022

That explains it; closing

@f0o f0o closed this as completed Nov 2, 2022
@matteius
Copy link
Member

matteius commented Nov 2, 2022

@f0o Actually though I am wondering if this has nothing to do with 3.11 -- Did you by chance install virtualenv from apt? If so, could you uninstall that and try installing it from pypi using pip? https://stackoverflow.com/questions/70583980/i-am-unable-to-create-a-new-virtualenv-in-ubuntu

@iamdbychkov
Copy link

iamdbychkov commented Dec 6, 2022

May I Bring this up again?

Having the same issue using 3.10.6.
removing virtualenv installed from apt made no difference.

pipx installations and bare pip installation behave the same.

Figured out it's not working for python2 installs via:
pipenv --python 2.7.18
Guess there was some change which made it unavailable.
Will post an update as soon as I check the version of pipenv which I use on another computer to create venvs.

@matteius
Copy link
Member

matteius commented Dec 6, 2022

@iamdbychkov There is a separate recent issue tracking this and a potential fix that perhaps won't always fix it because the version of python used may be different than the one creating the virtualenv. That issue is here: #5477 (comment)

Can you try the main branch which has the logic to check if venv is importable and then switches on which creator to use based on this? I would like more feedback on if that fixes it for the general use case or not.

@iamdbychkov
Copy link

iamdbychkov commented Dec 11, 2022

Hi @matteius ! Thank your for the reply :)

Have installed 2022.11.1.dev0 from main branch but no luck, unfortunately

Error read as follows:

image

Haven't got an opportunity to check pipenv version on work PC which handles such cases without problems.

I understand that python 2.7 is EOL and it might not be worth spending time to fix the issue. And if so, I would suggest to mark which version of pipenv still supports it, will gladly say which one as soon as I reach my office.

@iamdbychkov
Copy link

iamdbychkov commented Dec 12, 2022

image

2022.6.7 works fine on my work PC. Will check this version at home to verify it's not a linux distro issue

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

No branches or pull requests

3 participants