asdf-community / asdf-python

Python plugin for the asdf version manager
https://github.com/asdf-vm/asdf
MIT License
651 stars 56 forks source link

Broke a shim after pip uninstall then pip install -e .? #95

Open Cobertos opened 3 years ago

Cobertos commented 3 years ago

I somehow broke one of my shims,

I originally installed a module (promnesia) user-wide with pip3 install --user promnesia, then uninstalled with pip3 uninstall promnesia. I wanted to do dev work with the module, so I cloned down the repo and did a pip install -e . inside. This completed successfully. I can do

python
> import promnesia

with no issues. But when I try to use the shim, I get bash: /home/cobertos/.local/bin/promnesia: No such file or directory. I tried to asdf reshim, as well as deleting the shim in /home/cobertos/.asdf/shims/promnesia and then doing another asdf reshim and it still gives the same error.

It's almost like the shim is still pointing to the old --user installed version, somehow?

Cobertos commented 3 years ago

Woops, apparently I just needed a new terminal session?

command -v promnesia was returning /home/cobertos/.local/bin/promnesia in the old one (which doesn't exist), which is what with_shim_executable() uses to call $shim_exec which eventually is executed by asdf-python. The output of which promnesia outputs /home/cobertos/.asdf/shims/promnesia.

In a new terminal both command -v promnesia and which promnesia output /home/cobertos/.asdf/shims/promnesia.

The $PATH in both terminals appears to be the same though before running the commands, and trying to trace through the logic I can't see where the final PATH edit that would point to ~/Seafile/projects/FORKED/promnesia would be...

Solved my problem, but still confused

matschaffer commented 2 years ago

ha! I had this same problem

matschaffer commented 2 years ago

I think in my case the old terminal might have had the asdf shims pathed out by a direnv PATH_add call that I'd since removed.