python - 在 Debian 8 上使用 pip 安装 Python 3.5

标签 python debian

所以,我的问题非常简单,如何在 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/

相关文章:

SSH 添加 : could not add identity xxx agent refused operation

Python:将 pandas Series 转换为数组并保留索引

debian - 无法在 debian buster 上安装 libc6 版本 2.29/更新版本

python - 检查字典列表中是否已经存在值?

python - 我应该如何理解 dis.dis 的输出?

linux - HTTP 直播 : The Linux nightmare

php - 尝试在 Debian 8 v-server 上将 phalcon 更新到 3.0

由于勘误,Debian 固件错误 TSC_DEADLINE 被禁用

python - 避免使用 numpy 矩阵进行循环

python - 在单个Docker容器中运行crontab服务和wsgi是否正确