-
Notifications
You must be signed in to change notification settings - Fork 3k
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] No such file or directory on _IMPORT_CWD = os.path.abspath(os.getcwd()) #11036
Comments
this is a regression due to the introduction of set -euxo pipefail
pip="$PWD/venv/bin/pip"
"$pip" install pip=="$1"
mkdir y
cd y
rm -rf ../y
"$pip" --version $ bash t.sh 21.3.1
+ pip=/tmp/y/venv/bin/pip
+ /tmp/y/venv/bin/pip install pip==21.3.1
Collecting pip==21.3.1
Downloading pip-21.3.1-py3-none-any.whl (1.7 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 27.9 MB/s eta 0:00:00
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 22.0.4
Uninstalling pip-22.0.4:
Successfully uninstalled pip-22.0.4
Successfully installed pip-21.3.1
+ mkdir y
+ cd y
+ rm -rf ../y
+ /tmp/y/venv/bin/pip --version
pip 21.3.1 from /tmp/y/venv/lib/python3.8/site-packages/pip (python 3.8) $ bash t.sh 22.0.4
+ pip=/tmp/y/venv/bin/pip
+ /tmp/y/venv/bin/pip install pip==22.0.4
Requirement already satisfied: pip==22.0.4 in ./venv/lib/python3.8/site-packages (22.0.4)
+ mkdir y
+ cd y
+ rm -rf ../y
+ /tmp/y/venv/bin/pip --version
Traceback (most recent call last):
File "/tmp/y/venv/bin/pip", line 5, in <module>
from pip._internal.cli.main import main
File "/tmp/y/venv/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/tmp/y/venv/lib/python3.8/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/tmp/y/venv/lib/python3.8/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
from pip._internal.cli import cmdoptions
File "/tmp/y/venv/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.py", line 23, in <module>
from pip._internal.cli.parser import ConfigOptionParser
File "/tmp/y/venv/lib/python3.8/site-packages/pip/_internal/cli/parser.py", line 12, in <module>
from pip._internal.configuration import Configuration, ConfigurationError
File "/tmp/y/venv/lib/python3.8/site-packages/pip/_internal/configuration.py", line 20, in <module>
from pip._internal.exceptions import (
File "/tmp/y/venv/lib/python3.8/site-packages/pip/_internal/exceptions.py", line 14, in <module>
from pip._vendor.rich.console import Console, ConsoleOptions, RenderResult
File "/tmp/y/venv/lib/python3.8/site-packages/pip/_vendor/rich/__init__.py", line 16, in <module>
_IMPORT_CWD = os.path.abspath(os.getcwd())
FileNotFoundError: [Errno 2] No such file or directory |
Ah, of course. :) |
I've gone ahead and reported this upstream. We'll pull in the fix for this, in the pip release after this gets fixed + released in Rich. I'm going to eagerly close this, even though we usually track upstream fixes for issues -- this doesn't seem like something that foundationally affects pip's core functionality except in a weird edge case. |
Will be fixed in the next release of Rich. |
Description
I'm not sure what happened, but I couldn't find any issues that mentioned something similar (except for maybe this one?), so I thought I'd share, just in case.
I solved the problem with a complete reinstall of Pip using
Feel free to close if silly
Expected behavior
I expected pip3 to work. I could have sworn it worked fine the other day.
pip version
Unknown
Python version
3.9.2
OS
Raspberry Pi OS Bullseye, 32bit, Linux pi 5.10.103-v7+ #1529 SMP armv7l GNU/Linux
How to Reproduce
I do not know, it came out of nowhere.
Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: