所以,我的问题非常简单,如何在 Debian 8 上使用 pip 安装 Python 3.5,不会出现诸如 ImportError: Cannot import name ' 之类的错误HTTPSHandler'
?
最佳答案
到目前为止,我发现在 Linux 上安装 Python(尽管我还没有尝试过 Debian 8)的最简单方法是使用 python 发行版 Miniconda .
# Assuming you want 64bit
cd ~
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda-latest-Linux-x86_64.sh
# Agree to the license agreement and where to put it
# Add it to your $PATH
# Assuming you use bash (You might have to change this if my memory isn't correct...)
echo 'export PATH="~/miniconda3/bin:$PATH"' >> ~/.bashrc
# reload your .bashrc
source ~/.bashrc
# make sure it works
python --version # should print out 3.5
# install something with pip
pip install pyperclip # or anything
# make sure it works
python -c 'import pyperclip'
现在您可以使用 pip 了。不过,对于像 numpy 等复杂的二进制包,Miniconda 还附带了一个名为 conda
的工具。如果您需要的话,conda --help
或 google 应该可以帮助您开始这条路线。
如果您需要卸载 Miniconda,只需删除 ~/miniconda3
并从 ~/.bashrc
中删除上面提到的 PATH
行即可
此外,如果您有足够的空间并且想要大量“正常工作”的预装软件包,他们还推出了 Anaconda python .
如果您不使用终端,Anaconda 附带了一个不错的 IDE,Spyder ,可以通过从终端输入 spyder
来启动。
关于python - 在 Debian 8 上使用 pip 安装 Python 3.5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35385423/