By: @saurabhshri
Many users when are given server access, do not have root (or sudo) privileges and can not simply do
sudo apt-get install python-pip .
Here's an easy way you can install and use pip without root (or sudo) access in a local directory.
Note : This works without easy_install too.
- Download pip from an online repository :
wget https://bootstrap.pypa.io/get-pip.py - Install the downloaded package into a local directory :
python get-pip.py --userThis will install pip to your local directory(.local/bin). - Now you may navigate to this directory
(cd .local/bin)and then usepipor better set your $PATH variable this directory to usepipanywhere :PATH=$PATH:~/.local/binfollowed bysource ~/.bashrcto apply the changes.
And that's it. You may now install all python modules you require via pip in a local directory without root.
wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py --user
cd .local/bin
./pip install <package_name> --user


This came up as the first hit on Google for installing python packages as user but it's unfortunately mis-leading
This does not install in a local directory, it installs an OS specific user folder which is global for that user. It doesn't install in
.local/binin the current folder. It installs in~/.local/bin(in your case). In my case it installs in~/Library/Python/2.7/bin.In either case that's not "my local directory" it's a effectively my "home directory" which is sadly not what I was looking for since I have various projects that need incompatible packages so needed actual solution for "local directory"