-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
FileNotFoundError: [Errno 2] when installing pipenv from pipfile #5075
Comments
I don't think there should be a v in front of your version for 2022.4.20 on the solution line |
I am having the same issue on the new Ubuntu 22.04 but not the previous 21.10. I do not understand the problem but I have identified a workaround: I can reproduce the issue without pipenv. Something about the act of installing the setuptools dependency specified in pipenv’s setup.py breaks virtualenv creation on Ubuntu 22.04; no
fails with |
same problem:
what is see is virtualenv create complete other structure without bin
|
This happens with Downgrading setuptools to before version 60 works around the problem. Ubuntu 22.04 comes with version 59.6.0 but pipenv 2022.4.21 wants |
The (excellent!) bug report at pypa/setuptools#3278 identifies the cause more precisely. There are two better workarounds identified there:
|
@andrewdotn this worked for me :) |
@andrewdotn the |
@oz123 I am wondering what could have been different between |
Ah I forgot that I updated the minimum version of pip and setuptools when I dropped 3.6 support -- I think I based it on the versions that had dropped 3.6 support of those projects: https://github.com/pypa/pipenv/pull/5066/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R26 |
- Added temporary requirements_downgrade.patch file to revert upstream requirements changes to what's available in Arch (at the time of writing). Upstream appears to have bumped requirements unintentionally. See: - pypa/pipenv#5075 - pypa/pipenv#5075 (comment) git-svn-id: file:///srv/repos/svn-community/svn@1191061 9fca08f4-af9d-4005-b8df-a31f2cc04f65
- Added temporary requirements_downgrade.patch file to revert upstream requirements changes to what's available in Arch (at the time of writing). Upstream appears to have bumped requirements unintentionally. See: - pypa/pipenv#5075 - pypa/pipenv#5075 (comment) git-svn-id: file:///srv/repos/svn-community/svn@1191061 9fca08f4-af9d-4005-b8df-a31f2cc04f65
@andrewdotn I had to export in order for it to work: export SETUPTOOLS_USE_DISTUTILS=stdlib |
I would like some guidance on what the proper resolution would be for pipenv -- should we loosen the versions of setuptools in the setup.py? I am not convinced that we should allow such older versions of pip since we vendor in the latest pip, (I also thought we only used the pip internal to pipenv, and the fact that we use both I find troubling), anyway I am glad there is some work arounds, but I'd like to understand the path forward for this pipenv issue as well. |
I don't think the version of pip affects this? When the setuptools/virtualenv/distutils bug is resolved then pipenv can depend on the newer version of those. The difference between |
@andrewdotn trying to get rid of this warning:
|
@matteius This warning appears every time I run |
I also have these warnings every time I run pipenv. Although the command works, the warnings are undesired. I'm using unto 22.04 with WSL2. |
Can someone try this branch and see downgrading the setuptools specifier is enough? #5087 |
@matteius Sure. I tested but it did not solve the problem. I did the following commands: $ pip uninstall pipenv
$ pip install "git+https://github.com/pypa/pipenv.git@issue-5075-setuptools" Then, tried to create the env: $ pipenv install The result was: /home/user/.local/lib/python3.10/site-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
/home/user/.local/lib/python3.10/site-packages/pkg_resources/__init__.py:123: 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: /home/user/tmp/Pipfile
Using /usr/bin/python3 (3.10.4) to create virtualenv...
⠙ Creating virtual environment...created virtual environment CPython3.10.4.final.0-64 in 403ms
creator CPython3Posix(dest=/home/user/.local/share/virtualenvs/tmp-K1LwcDUA, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/user/.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 "/home/user/.local/bin/pipenv", line 8, in <module>
sys.exit(cli())
File "/home/user/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/home/user/.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/user/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/home/user/.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/user/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/user/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/user/.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/user/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/user/.local/lib/python3.10/site-packages/pipenv/cli/command.py", line 222, in install
do_install(
File "/home/user/.local/lib/python3.10/site-packages/pipenv/core.py", line 1965, in do_install
ensure_project(
File "/home/user/.local/lib/python3.10/site-packages/pipenv/core.py", line 553, in ensure_project
ensure_virtualenv(
File "/home/user/.local/lib/python3.10/site-packages/pipenv/core.py", line 486, in ensure_virtualenv
do_create_virtualenv(
File "/home/user/.local/lib/python3.10/site-packages/pipenv/core.py", line 1013, in do_create_virtualenv
project._environment = Environment(
File "/home/user/.local/lib/python3.10/site-packages/pipenv/environment.py", line 70, in __init__
self._base_paths = self.get_paths()
File "/home/user/.local/lib/python3.10/site-packages/pipenv/environment.py", line 394, in get_paths
c = subprocess_run(command)
File "/home/user/.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/user/.local/share/virtualenvs/tmp-K1LwcDUA/bin/python' |
@matteius Yup, that branch works for me when I change the @felipecrp Did you try that command on a fresh machine? Or maybe after first uninstalling setuptools? Installing just the updated pipenv in an environment that was already experiencing this issue won’t automatically downgrade or remove an updated setuptools. |
@andrewdotn @matteius If I uninstall setuptools, it works, but I still get the warnings. $ pip uninstall pipenv
$ pip uninstall setuptools
$ pip install "git+https://github.com/pypa/pipenv.git@issue-5075-setuptools"
$ pipenv install The command successfully creates the env, but still with some warnings.
|
Those warnings are nothing to do with pipenv. They're coming from pkg_resources and would need to be reported to Ubuntu, but this warning has been present for several Ubuntu LTS releases now. |
I don't know but I only see them when I run |
@felipecrp its definitely been reported before the new versions about the warnings for pkg_resources. Here is an example, and there are a couple more if you search the closed issues: #4960 |
I believe that the pull request solves this issue. Thank you all for the help! |
It happens again even after I remove
|
Why is
|
|
I was getting the same See warnings
Searching for the origin of those warnings, I stumbled upon this StackOverflow question. Following the accepted answer, I downgraded
After that, I rerun
|
edit: workaround __ It looks like it is trying to graph the wrong executable location for the python interpreter. it is looking for Traceback (most recent call last):
File "/home/tony/.local/bin/pipenv", line 8, in <module>
sys.exit(cli())
File "/home/tony/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/home/tony/.local/lib/python3.10/site-packages/pipenv/cli/options.py", line 57, in main
return super().main(*args, **kwargs, windows_expand_args=False)
File "/home/tony/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/home/tony/.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/tony/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/tony/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/tony/.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/tony/.local/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/tony/.local/lib/python3.10/site-packages/pipenv/cli/command.py", line 398, in shell
do_shell(
File "/home/tony/.local/lib/python3.10/site-packages/pipenv/core.py", line 2533, in do_shell
ensure_project(
File "/home/tony/.local/lib/python3.10/site-packages/pipenv/core.py", line 526, in ensure_project
ensure_virtualenv(
File "/home/tony/.local/lib/python3.10/site-packages/pipenv/core.py", line 459, in ensure_virtualenv
do_create_virtualenv(
File "/home/tony/.local/lib/python3.10/site-packages/pipenv/core.py", line 964, in do_create_virtualenv
project._environment = Environment(
File "/home/tony/.local/lib/python3.10/site-packages/pipenv/environment.py", line 80, in __init__
self._base_paths = self.get_paths()
File "/home/tony/.local/lib/python3.10/site-packages/pipenv/environment.py", line 391, in get_paths
c = subprocess_run(command)
File "/home/tony/.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/tony/repos/graphql-playground/backend/.venv/bin/python'
|
The |
I still have to use #5075 (comment) solution.
|
I am now getting the same error now that I upgraded my Ubuntu VM (22.0.4) ... the |
After installing Ubuntu I used this command to update pipenv
Not sure if that helps! |
The problem for making this better in pipenv is how to tell when it should be |
I spent some more time on this, and I think the best workaround, which is reflected in https://github.com/pypa/pipenv/pull/5376/files, is to use |
Does this work if python3-venv package is missing? |
|
You need to check with
|
@oz123 Appears to work:
|
It appears that Ubuntu is distributing |
THIS WORKED FOR ME
|
Fix will be in the next release. |
none of the above worked for me, what worked was simply removing the already created venv: |
Hi all,
I am experiencing some issues while building my docker file on the last shown step (1):
I get the following Stacktrace:
The solution I found is:
The build image is ubuntu:22.04, python-version 3.10.4
The text was updated successfully, but these errors were encountered: