我已在共享的Bluehost服务器上成功安装了python 2.7.11。
在主目录中我安装了get-pip.py当我现在运行时,
# python get-pip.py
Requirement already up-to-date: pip in ./python/lib/python2.7/site-packages
但是当我尝试运行pip时,我得到了,
usernmame@example.com [~]# pip
-bash: pip: command not found
为什么pip没有运行?如何查看安装了哪些python包?
我的〜/ .bashrc看起来像这样,
# .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
此外,
# 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
修改
我尝试在〜/ .bashrc
中添加$ PATH的路径export PATH=$HOME/python/Python-2.7.11/:$HOME/python/lib/python2.7/site-packages/:$PATH
但它不起作用,同样的错误。
由于
答案 0 :(得分:3)
使用pip
运行-m
时,可以通过调用python
选项运行pip
。假设您要使用pip
从PyPI安装名为“感兴趣的包”的Python包。然后,您可以通过运行:
python -m pip install package-of-interest