asdf-community / asdf-python

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

Reshimming doesn't add pip packages to path #78

Closed H12 closed 3 years ago

H12 commented 4 years ago

I'm running asdf v0.8, and python version 3.8.6 on the latest version of this plugin (at the time of writing).

When I pip install a package (in my case ansible) and run asdf reshim python, the package does not appear in my $PATH:

➜  ~ asdf --version
v0.8.0-c6145d0
➜  ~ asdf plugin update python
Updating python...
Already on 'master'
Your branch is up to date with 'origin/master'.
➜  ~ asdf list
...
python
  3.8.6
...
➜  ~ pip list
Package      Version
------------ -------
...
ansible      2.10.1
...
➜  ~ ansible
zsh: command not found: ansible
➜  ~ asdf reshim python
➜  ~ ansible
zsh: command not found: ansible

My workaround was to add the following in my shell's rc file:

PATH="$PATH:$(python -m site --user-base)/bin"

Not quite sure how to investigate this further. Curious whether others have experienced the same problem.

danhper commented 4 years ago

Could it be that you installed ansible with pip install --user ansible? In this case, it will indeed not work because asdf is designed to work with binaries installed in the Python install bin directory. Simply removing the --user should do the trick. Let me know if that helps.

karlosmid commented 3 years ago

Hi! I tried without user option and after reshim command, ansible is still not present in PATH

H12 commented 3 years ago

Hi @danhper, sorry for the late response! I got a new laptop and unfortunately no longer have access to how I initially installed ansible on that machine.

However, after installing it on my new machine (without the --user flag), asdf reshim python works and successfully adds ansible to my path.

For that reason I'm going to close out this issue. Thanks!

alex-popov-tech commented 3 years ago

still relevant :(