ofey ofey - 1 year ago 75
Python Question

Installing pip on Bluehost

I have successfully installed python 2.7.11 on a shared Bluehost server.

In the home directory I installed get-pip.py When I run that now,

# python get-pip.py
Requirement already up-to-date: pip in ./python/lib/python2.7/site-packages


But when I try to run pip I get,

[email protected] [~]# pip
-bash: pip: command not found


Why is pip not running? How can I check what python packages are installed?

My ~/.bashrc looks like this,

# .bashrc
export PATH=$HOME/python/Python-2.7.11/:$PATH
# User specific aliases and functions
alias mv='mv -i'
alias rm='rm -i'
alias cp='cp -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi


Additionally,

# echo $PATH
/usr/local/jdk/bin:/home2/username/python/Python-2.7.11/:/usr/lib64/qt-3.3/bin:/home2/username/perl5/bin:/ramdisk/php/54/bin:/usr/php/54/usr/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin:/home2/username/bin


EDIT:

My attempt to add the path to $PATH in ~/.bashrc

export PATH=$HOME/python/Python-2.7.11/:$HOME/python/lib/python2.7/site-packages/:$PATH


But it doesn't work, same error.

Thanks

Answer Source

You can run pip by invoking the -m option when you use python to run pip. Suppose you want to use pip to install a Python package called "package-of-interest" from PyPI. Then, you can install it by running:

python -m pip install package-of-interest
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download