Where does pip3 install package binaries?

Question:

It see that depending on system and configuration, packages are installed in different places.

Example:
Machine 1:

pip3 install fb-idb 
pip3 show fb-idb
> ...
> /opt/homebrew/lib/python3.9/site-packages

Machine 2:

pip3 install fb-idb 
pip3 show fb-idb
> ...
> /us/local/lib/python3.10/site-packages

Now the problem I have is that on machine 1, I got the path to the binary by executing
which idb (> /opt/homebrew/bin/idb), but on machine 2, it seems the bin dir wasn’t added to the path, so which doesn’t work.

Is there a way to figure out where the binaries are installed, if I only have the site-packages path?

Asked By: stoefln

||

Answers:

pip3 show --files fb-idb shows where pip has installed all the files of the package. Run

pip3 show --files fb-idb | grep -F /bin/

to extract the directory where pip installed scripts and entry points (On Windows it’s Scripts). The directories are related to the header Location: so either do grep -F Location: separately or do it combined:

pip3 show --files fb-idb | grep 'Location:|/bin/'
Answered By: phd
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.