如何在 Python 3.6 上安装 PIP?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43304612/
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-19 22:50:21  来源:igfitidea点击:

How to install PIP on Python 3.6?

pythonpip

提问by bradley plater

I'm trying to Install PIP for python 3.6 and I've looked over YouTube for tutorials but all of them seem to be out of date and none of them have seemed to work. Any information would be helpful so I can carry on with my project.

我正在尝试为 python 3.6 安装 PIP,我已经在 YouTube 上查看了教程,但所有教程似乎都过时了,而且似乎都没有工作。任何信息都会有所帮助,因此我可以继续我的项目。

回答by fstennet

pipis bundled with Python > 3.4

pip与 Python > 3.4 捆绑

On Unix-like systems use:

在类 Unix 系统上使用:

python3.6 -m pip install [Package_to_install]

On a Windows system use:

在 Windows 系统上使用:

py -m pip install [Package_to_install]

(On Windows you may need to run the command prompt as administrator to be able to write into python installation directory)

(在 Windows 上,您可能需要以管理员身份运行命令提示符才能写入 python 安装目录)

回答by Jim isaac

Download python 3.6

下载 python 3.6

It is possible that pip does not get installed by default. One potential fix is to open cmd and type:

默认情况下可能未安装 pip。一种可能的解决方法是打开 cmd 并键入:

python -m ensurepip --default-pip

and then

进而

python -m pip install matplotlib

actually i had nothing in my scripts folder idk why but these steps worked for me.

实际上我的脚本文件夹中没有任何内容 idk 为什么但这些步骤对我有用。

回答by Will I Am

If pip doesn't come with your installation of python 3.6, this may work:

如果 pip 没有随您安装的 python 3.6 一起提供,这可能会起作用:

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

then you can python -m install

然后你可以 python -m install

回答by Adam Katav

pip is included in Python installation. If you can't call pip.exe try calling python -m pip [args] from cmd

pip 包含在 Python 安装中。如果你不能调用 pip.exe 尝试从 cmd 调用 python -m pip [args]

回答by Inyoka

How did you install Python, and are you using a virtual environment?
As you specifically mentioned Python 3.6, and you have not marked this as answered I will make a guess that you might have installed it using sudo add-apt-repository ppa:jonathonf/python-3.6, as this is a common way to install Python 3.6 on a Unix OS that doesn't have a native 3.6 package. If this is the case the correct way to install pip is as follows ....

你是如何安装 Python 的,你使用的是虚拟环境吗?
正如您特别提到的 Python 3.6,并且您没有将其标记为已回答,我会猜测您可能已经使用sudo add-apt-repository ppa:jonathonf/python-3.6安装了它,因为这是安装 Python 的常用方法3.6 在没有原生 3.6 包的 Unix 操作系统上。如果是这种情况,安装 pip 的正确方法如下......

Step 1) Make a Virtual Environment with Python 3.6 ...

步骤 1) 使用 Python 3.6 创建虚拟环境 ...

python3.6 -m venv env --without-pip

Step 2) Activate your virtual environemnt ...

步骤 2) 激活您的虚拟环境...

source env/bin/activate

Step 3) Install pip into your environemnt ...

步骤 3) 将 pip 安装到您的环境中...

curl https://bootstrap.pypa.io/get-pip.py | python3

回答by Rajiv Sharma

I Used these commands in Centos 7

我在 Centos 7 中使用了这些命令

yum install python36
yum install python36-devel
yum install python36-pip
yum install python36-setuptools
easy_install-3.6 pip

to check the pip version:

检查 pip 版本:

pip3 -V
pip 18.0 from /usr/local/lib/python3.6/site-packages/pip-18.0-py3.6.egg/pip (python 3.6)

回答by Letsintegreat

There are situations when your pipdoesn't get downloaded along with python installation. Even your whole script folder can be empty.

在某些情况下,您pip没有随 python 安装一起下载。甚至整个脚本文件夹也可能是空的。

You can do so manually as well.

您也可以手动执行此操作。

Just head to Command Prompt and type python -m ensurepip --default-pipPress Enter.

只需前往命令提示符并键入python -m ensurepip --default-pip按 Enter。

Make sure that value of path variable is updated.

确保路径变量的值已更新。

This will do the Trick

这将做的伎俩

回答by Manni

I have in this moment install the bs4 with python 3.6.3 on Windows.

此时我已经在 Windows 上安装了带有 python 3.6.3 的 bs4。

C:\yourfolderx\yourfoldery>python.exe -m pip install bs4

with the syntax like the user post below:

使用类似于以下用户帖子的语法:

I just successfully installed a package for excel. After installing the python 3.6, you have to download the desired package, then install. For eg,

我刚刚成功安装了一个excel包。安装python 3.6后,您必须下载所需的包,然后安装。例如,

python.exe -m pip download openpyxl==2.1.4

python.exe -m pip install openpyxl==2.1.4

回答by rfkortekaas

Since python 3.4 pip is included in the installation of python.

由于python 3.4 pip 包含在python 的安装中。

回答by ashenskye

There is an issue with downloading and installing Python 3.6. Unchecking pip in the installation prevents the issue. So pip is not given in every installation.

下载和安装 Python 3.6 时存在问题。在安装中取消选中 pip 可以防止出现此问题。所以 pip 并不是在每个安装中都给出。