Python 3.6 没有名为 pip 的模块

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44622182/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 00:15:00  来源:igfitidea点击:

Python 3.6 No module named pip

pythonpippython-3.6fedora

提问by arielnmz

I have just installed Python 3.6 on Fedora 25 (64 bits) by running dnf install python36and 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:

我刚刚通过运行在 Fedora 25(64 位)上安装了 Python 3.6 dnf install python36,我不能使用 Python 3.5 可以正常使用的任何模块,例如,PyCharm 抱怨没有安装安装工具,我也可以运行 python3 并发出:

import aiohttp

However, if run python36 and then:

但是,如果运行 python36 然后:

import aiohttp

I instead get:

我反而得到:

Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp'

回溯(最近一次调用):文件“”,第 1 行,在 ModuleNotFoundError 中:没有名为“aiohttp”的模块

Pip is also not present on python36, as python36 -m pip throws:

python36 上也不存在 Pip,因为 python36 -m pip 抛出:

/usr/bin/python36: No module named pip

/usr/bin/python36: 没有名为 pip 的模块

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

我必须注意,我同时安装了 python 3.4、3.5 和 3.6,3.4 和 3.5 都可以正常工作

回答by Klaus D.

On Fedora 25Python 3.6 comes as a minimalistic version without pipand without additional dnfinstallable modules.

Fedora 25 上,Python 3.6 是一个简约的版本,没有pip或没有额外的可dnf安装模块。

But you can manually install pip:

但是您可以手动安装pip

wget https://bootstrap.pypa.io/get-pip.py
sudo python3.6 get-pip.py

After that you can use it as python3.6 -m pipor just pip3.6.

之后,您可以将其用作python3.6 -m pip或仅使用pip3.6.

回答by Siva Karuppiah

sudo dnf install python3

须藤 dnf 安装 python3

Try this.

尝试这个。

回答by Prakash Palnati

In Debian distributions, you can run

在 Debian 发行版中,您可以运行

sudo apt-get install python-pip ##for python2

sudo apt-get install python3-pip ##for python3