Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why packages installed with pip install --user option are not 'visible' from shell?

When I install e.g. conan.io with pip like so

sudo pip install conan

after the installation passes (and installs the packages to /usr/local/lib/python2.7/dist-packages/) I can easily trigger command from the installed package (here conan) and my shell will find it but when I install it in user model like so:

pip install --user conan

it will install it to ~/.local/lib/python2.7/site-packages/ and my shell will not find it.

What am I doing wrong here or what am I missing?

like image 975
Patryk Avatar asked Dec 10 '16 11:12

Patryk


People also ask

Where does pip install -- user install?

Use Pip --user installs for your default environment Notice the line /home/vagrant/. local/lib/python2. 7/site-packages . This is the path containing packages that have been installed with the Pip --user option.

Does pip install packages for all users?

By default, the “pip install” command is used to install a package for all users. This means the package will be installed into the system directory like “/usr/local/lib/python3. 8” in Linux systems.

Why pip install is not working?

This error usually means there's a problem with the Python installation or the system variable PATH is not set up correctly. Try reinstalling Python and all its components to fix the problem. The easiest way is via the Python executable installer.

Where does pip install Look for packages?

pip looks for packages in a number of places: on PyPI (if not disabled via --no-index ), in the local filesystem, and in any additional repositories specified via --find-links or --index-url .


1 Answers

Shell scripts are installed in ~/.local/bin, you have to add the directory to your $PATH:

export PATH=$HOME/.local/bin:$PATH; conan

should work.

like image 171
Andrey Sobolev Avatar answered Oct 01 '22 03:10

Andrey Sobolev