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

Error creating virtualenv with python 3.10 #5288

Closed
abouletupjv opened this issue Aug 23, 2022 · 9 comments
Closed

Error creating virtualenv with python 3.10 #5288

abouletupjv opened this issue Aug 23, 2022 · 9 comments
Labels
Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged. hacktoberfest

Comments

@abouletupjv
Copy link

Hi,

When I try to create an environnement i got the following errors:

web-pole3@python-release:/var/lib/python/projects-RELEASE/mon_app_demo$ pipenv shell
/home/disi/web-pole3/.local/lib/python3.10/site-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.16.0-unknown is an invalid version and will not be supported in a future release
  warnings.warn(
/home/disi/web-pole3/.local/lib/python3.10/site-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
  warnings.warn(
Creating a virtualenv for this project...
Pipfile: /var/lib/python/projects-RELEASE/mon_app_demo/Pipfile
Using /usr/bin/python3 (3.10.4) to create virtualenv...
⠏ Creating virtual environment...created virtual environment CPython3.10.4.final.0-64 in 2083ms
  creator CPython3Posix(dest=/home/disi/web-pole3/.local/share/virtualenvs/mon_app_demo-oYHeBM4M, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/disi/web-pole3/.local/share/virtualenv)
    added seed packages: pip==22.2.2, setuptools==63.4.1, 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 "/home/disi/web-pole3/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/disi/web-pole3/.local/lib/python3.10/site-packages/pipenv/cli/options.py", line 56, in main
    return super().main(*args, **kwargs, windows_expand_args=False)
  File "/home/disi/web-pole3/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/disi/web-pole3/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/disi/web-pole3/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/disi/web-pole3/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/disi/web-pole3/.local/lib/python3.10/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/disi/web-pole3/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/disi/web-pole3/.local/lib/python3.10/site-packages/pipenv/cli/command.py", line 414, in shell
    do_shell(
  File "/home/disi/web-pole3/.local/lib/python3.10/site-packages/pipenv/core.py", line 2427, in do_shell
    ensure_project(
  File "/home/disi/web-pole3/.local/lib/python3.10/site-packages/pipenv/core.py", line 552, in ensure_project
    ensure_virtualenv(
  File "/home/disi/web-pole3/.local/lib/python3.10/site-packages/pipenv/core.py", line 485, in ensure_virtualenv
    do_create_virtualenv(
  File "/home/disi/web-pole3/.local/lib/python3.10/site-packages/pipenv/core.py", line 1012, in do_create_virtualenv
    project._environment = Environment(
  File "/home/disi/web-pole3/.local/lib/python3.10/site-packages/pipenv/environment.py", line 70, in __init__
    self._base_paths = self.get_paths()
  File "/home/disi/web-pole3/.local/lib/python3.10/site-packages/pipenv/environment.py", line 394, in get_paths
    c = subprocess_run(command)
  File "/home/disi/web-pole3/.local/lib/python3.10/site-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/disi/web-pole3/.local/share/virtualenvs/mon_app_demo-oYHeBM4M/bin/python'

it try to execute python in mon_app_demo-oYHeBM4M/bin/python but it is located in mon_app_demo-oYHeBM4M/local/bin/python

if i downgrade setuptools to version 59.8.0 it works because the python is located in mon_app_demo-oYHeBM4M/bin folder

@matteius
Copy link
Member

That is really odd -- how would downgrading setuptools change the python location?

@abouletupjv
Copy link
Author

abouletupjv commented Aug 24, 2022

I think this is linked to distutils pypa/setuptools#2896

@matteius
Copy link
Member

@abouletupjv Can you re-check with pipenv==2022.8.24?

@matteius matteius added the Status: Awaiting Update ⏳ This issue requires more information before assistance can be provided. label Aug 24, 2022
@matteius
Copy link
Member

I wonder if your virtualenv was just created on a much older version? Can you try upgrading to pipenv, version 2022.8.30 and then re-create your virtualenv with pipenv --rm and then pipenv sync and pipenv sync --dev if you need dev dependencies?

@stumpylog
Copy link
Contributor

stumpylog commented Sep 22, 2022

I'm running into this issue with 2022.9.21. The python executable is being installed to .venv/local/bin/python, but the expected location is .venv/bin/python.

pip==22.2.2
setuptools==65.3.0

@matteius matteius added hacktoberfest Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged. and removed Status: Awaiting Update ⏳ This issue requires more information before assistance can be provided. labels Sep 22, 2022
@kicksmackbyte
Copy link

+1

@matteius
Copy link
Member

matteius commented Oct 3, 2022

Fix is in the main branch, will cut a release sometime (soon) this week.

@JonZeolla
Copy link

Thank you; I am also encountering this issue.

@matteius
Copy link
Member

matteius commented Oct 5, 2022

Just cut pipenv 2022.10.4 -- should address this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged. hacktoberfest
Projects
None yet
Development

No branches or pull requests

5 participants