Python 3.6 没有名为 pip 的模块 [英] Python 3.6 No module named pip
问题描述
我刚刚通过运行 dnf install python36
在 Fedora 25(64 位)上安装了 Python 3.6,但我无法使用 Python 3.5 可以正常使用的任何模块,例如,PyCharm 抱怨没有安装安装工具,我也可以运行 python3 并发出:
I have just installed Python 3.6 on Fedora 25 (64 bits) by running dnf install python36
and I can't use any modules Python 3.5 can otherwise use just fine, for example, PyCharm complains about setup tools not being installed, also I can run python3 and issue:
import aiohttp
但是,如果运行 python36 然后:
However, if run python36 and then:
import aiohttp
我反而得到:
回溯(最近一次调用最后一次):文件",第 1 行,在ModuleNotFoundError: 没有名为aiohttp"的模块
Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp'
python36 上也不存在 Pip,因为 python36 -m pip 抛出:
Pip is also not present on python36, as python36 -m pip throws:
/usr/bin/python36: 没有名为 pip 的模块
/usr/bin/python36: No module named pip
我必须注意,我同时安装了 python 3.4、3.5 和 3.6,3.4 和 3.5 都运行良好
I have to note that I've got python 3.4, 3.5 and 3.6 installed at the same time, both 3.4 and 3.5 working just fine
推荐答案
在 Fedora 25 上,Python 3.6 是一个简约的版本,没有 pip
,也没有额外的 dnf
可安装模块.
On Fedora 25 Python 3.6 comes as a minimalistic version without pip
and without additional dnf
installable modules.
但是你可以手动安装pip
:
wget https://bootstrap.pypa.io/get-pip.py
sudo python3.6 get-pip.py
之后,您可以将其用作 python3.6 -m pip
或仅使用 pip3.6
.
After that you can use it as python3.6 -m pip
or just pip3.6
.
这篇关于Python 3.6 没有名为 pip 的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!