ofey ofey -3 years ago 159
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,

usernmame@example.com [~]# 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


# echo $PATH


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.


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