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.

Error creating virtualenv with python 3.10

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:9

github_iconTop GitHub Comments

1reaction
matteiuscommented, Oct 3, 2022

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

1reaction
stumpylogcommented, 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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot create venv for Python 3.10
Trying to create venv for Python 3.10 using "python3.10 -m venv venv get error message: Error: Command ...
Read more >
Windows Python (<=3.10.2) fails to run `python -m venv .venv`
venv \Scripts\python.exe then it returns an error Unable to create process using 'C:\Users\kesh\AppData\Local\Programs\Python\Python310\python.
Read more >
Installing and using virtualenv with Python 3
Virtualenv is a tool used to create an isolated Python environment. This environment has its own installation directories that doesn't share ...
Read more >
Using a virtualenv for your web app - PythonAnywhere help
A virtualenv is a way to create a python environment that's isolated and separate from the normal system-wide installed packages.
Read more >
Cannot create a virtual enviroment with Python 3.8.10 on ...
The following information may help to resolve the situation: The following packages have unmet dependencies: python3.8-venv : Depends: python3.8 ...
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