-
Notifications
You must be signed in to change notification settings - Fork 444
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
Updating Python from 3.9.1_4 to 3.9.1_8 causes No such file or directory #633
Comments
Is your pipx also installed from Homebrew? If so, this is basically unfixable on pipx’s side due to how it swaps Python installations from under a Python application whenever the |
Because the symlink in the venv points to the full path for |
It seems like the shared lib venv is broken as well though, and reinstall-all doesn't fix that (iiuc). Maybe pipx should automatically rebuild the shared lib venv if it finds the underlying interpreter is gone? |
We now do upgrade the shared libraries during |
Oh I see I missed that error message on reinstall-all. Hmm that is weird. I haven't seen that error before and I have to occasionally reinstall-all due to Homebrew python upgrades. From the stacktrace though, yes it does look like upgrading the shared libraries is not working right. OK, sorry now I'm up to speed @uranusjr . We probably need to replace |
One thing we could consider is to not resolve the symlinks all the way to the source for the python executable. This is how we get to the specific I haven't figured out in the code exactly how this happens, but I do know that if I manually make a venv using |
I believe full symlink resolution is a hard requirement of PEP 405 and cannot change. |
I don't quite understand why we get to the path that we do. On my system, running |
PEP 405 virtual environments finds the “original” interpreter by the |
If I create a venv with
then I end up in the If I create a venv with
then I end up in the How does that happen? Especially because |
Huh, that’s interesting. |
No, but it is pip installed into that Homebrew Python system site-packages (i.e. I did observe that my Python links seem to have been lost in the latest homebrew update as well. In particular, |
Ah yes, thanks, it is the difference between I'm wondering if it's possible for us to get a link to a python in our venvs that's more upgrade-independent, e.g. for example not linking to the exact Homebrew python3.9 update.
|
@jaraco one workaround would be to set > PIPX_DEFAULT_PYTHON=/usr/local/bin/python3 pipx install pylint
installed package pylint 2.6.2, Python 3.9.2
These apps are now globally available
- epylint
- pylint
- pyreverse
- symilar
done! ✨ 🌟 ✨
> ll ~/.local/pipx/venvs/pylint/bin
total 96
-rw-r--r-- 1 mclapp staff 8834 Feb 20 22:03 Activate.ps1
-rw-r--r-- 1 mclapp staff 1915 Feb 20 22:03 activate
-rw-r--r-- 1 mclapp staff 864 Feb 20 22:03 activate.csh
-rw-r--r-- 1 mclapp staff 2004 Feb 20 22:03 activate.fish
-rwxr-xr-x 1 mclapp staff 252 Feb 20 22:03 epylint*
-rwxr-xr-x 1 mclapp staff 242 Feb 20 22:03 isort*
-rwxr-xr-x 1 mclapp staff 276 Feb 20 22:03 isort-identify-imports*
-rwxr-xr-x 1 mclapp staff 250 Feb 20 22:03 pylint*
-rwxr-xr-x 1 mclapp staff 256 Feb 20 22:03 pyreverse*
lrwxr-xr-x 1 mclapp staff 7 Feb 20 22:03 python@ -> python3
lrwxr-xr-x 1 mclapp staff 22 Feb 20 22:03 python3@ -> /usr/local/bin/python3
lrwxr-xr-x 1 mclapp staff 7 Feb 20 22:03 python3.9@ -> python3
-rwxr-xr-x 1 mclapp staff 252 Feb 20 22:03 symilar* |
Would that work? Even though this would give you a working |
I think it should be fine, this is what
There's something much different that happens when using |
Thanks for the quick response on this. I’ll keep an eye out next time I do an update in this environment. |
I've been doing experiments and am still slightly puzzled where |
I'm still experiencing this issue. I've added the following to by shell init config:
And run |
Yesterday, I ran brew upgrade. After that, my shell (xonsh), as installed by pipx, stopped running. It would fail with:
So I load up bash and inspect:
It seems
python3.9
no longer points to a valid Python, and thus all pipx commands are now broken.I was able to
reinstall-all
, which worked, but also emitted an error:I have pipx 0.16.0.0.
Is it the case that a
reinstall-all
is expected to be needed between patch updates to Python? I haven't experienced this issue on my other mac where I have Homebrew installed in the canonical location. Is there anything that one can do to avoid this failure when runningbrew upgrade
?The text was updated successfully, but these errors were encountered: