python - 在 Bluehost 上安装 pip

标签 python installation pip

我已经在共享的 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

但是不行,同样的错误。

谢谢

最佳答案

当您使用python 运行pip 时,您可以通过调用-m 选项来运行pip。假设您想使用 pip 从 PyPI 安装一个名为“package-of-interest”的 Python 包。然后,您可以通过运行来安装它:

python -m pip install package-of-interest

关于python - 在 Bluehost 上安装 pip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38149726/

相关文章:

python - 如何在 DataFrame 的字符串列中应用正则表达式替换?

python - 矩阵链应用中括号的可能组合

linux - 如何在 CMake execute_process 中使用 find -exec?

python - pip 错误 : bad interpreter: No such file or directory

python - 无法在 Ubuntu 18 中安装 sasl 包

python - 如何修复尝试安装 Tensorflow 导致的异常?

python - 修补 Python 包,作为 Pip 的依赖项安装

Python Keras - Windows 和 Linux 之间的兼容性

python - 递归循环时的组列表

ruby-on-rails - 在 Ubuntu 或 Mint 上安装 Ruby on Rails