Python 3.6没有名为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
.