问题:如何在Python 3.6上安装PIP?

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

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.


回答 0

pip 与Python> 3.4捆绑在一起

在类Unix系统上使用:

python3.6 -m pip install [Package_to_install]

在Windows系统上,请使用:

py -m pip install [Package_to_install]

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

pip is bundled with Python > 3.4

On Unix-like systems use:

python3.6 -m pip install [Package_to_install]

On a Windows system use:

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)


回答 1

下载python 3.6

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

python -m ensurepip --default-pip

然后

python -m pip install matplotlib

实际上,我的脚本文件夹idk中什么都没有,但是为什么这些步骤对我有用。

Download python 3.6

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

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.


回答 2

如果您的python 3.6安装未附带pip,则可以使用:

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

那么你可以python -m安装

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

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

then you can python -m install


回答 3

pip包含在Python安装中。如果您无法调用pip.exe,请尝试从cmd调用python -m pip [args]

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


回答 4

您是如何安装Python的,并且您正在使用虚拟环境?
正如您特别提到的Python 3.6,并且您尚未将其标记为已回答,我猜测您可能已使用sudo add-apt-repository ppa:jonathonf / python-3.6安装了它,因为这是安装Python的一种常见方法在没有本机3.6软件包的Unix OS上使用3.6。如果是这种情况,则正确安装pip的方法如下….

步骤1)使用Python 3.6建立虚拟环境…

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

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

source env/bin/activate

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

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

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 ….

Step 1) Make a Virtual Environment with Python 3.6 …

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

Step 2) Activate your virtual environemnt …

source env/bin/activate

Step 3) Install pip into your environemnt …

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

回答 5

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

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

检查点子版本:

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

I Used these commands in 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:

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

回答 6

在某些情况下,您pip不会随着python安装一起下载。即使您的整个脚本文件夹也可以为空。

您也可以手动进行操作。

只需转到命令提示符,然后python -m ensurepip --default-pip按Enter。

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

这会做把戏

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

You can do so manually as well.

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

Make sure that value of path variable is updated.

This will do the Trick


回答 7

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

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


回答 8

下载和安装Python 3.6时出现问题。取消选中安装中的pip可以避免此问题。因此,并非每次安装都提供pip。

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.


回答 9

我现在在Windows上用python 3.6.3安装bs4。

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

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

我刚刚成功安装了excel软件包。安装python 3.6之后,您必须下载所需的软件包,然后进行安装。例如

python.exe -m pip download openpyxl==2.1.4

python.exe -m pip install openpyxl==2.1.4

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

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,

python.exe -m pip download openpyxl==2.1.4

python.exe -m pip install openpyxl==2.1.4

回答 10

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

  1. python.exe -m pip download openpyxl==2.1.4

  2. python.exe -m pip install openpyxl==2.1.4

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,

  1. python.exe -m pip download openpyxl==2.1.4

  2. python.exe -m pip install openpyxl==2.1.4


回答 11

是的,Python3.6安装了PIP,但由于已安装,因此无法访问。没有代码可以直接调用它!我已经呆了一个多星期了,我读了给出的每条建议,都没有成功!

最后,我测试了转到pip目录并升级已安装的版本:

root@bx:/usr/local/lib/python3.6/site-packages # python -m pip install --upgrade pip

该命令创建了一个PIP,该PIP现在可以在FreeBSD服务器上的任何位置正常工作!

显然,所安装的工具根本无法正常工作,就像Python3.6一样。运行它们的唯一方法是调用Python和所需的python文件,如您在发出的命令中所见。但是,一旦调用了更新,新的PIP就可以在全局范围内工作,而不必调用Python3.6 …

Yes, Python3.6 installs PIP but it is unreachable as it is installed. There is no code which will invoke it as it is! I have been at it for more than a week and I read every single advice given, without success!

Finally, I tested going to the pip directory and upgrading the installed version:

root@bx:/usr/local/lib/python3.6/site-packages # python -m pip install --upgrade pip

That command created a PIP which now works properly from any location on my FreeBSD server!

Clearly, the tools installed simply do not work, as installed with Python3.6. The only way to run them is to invoke Python and the desired python files as you can see in the command issued. Once the update is called, however, the new PIP works globally without having to invoke Python3.6…


回答 12

这在Amazon Linux上对我有用

sudo yum list | grep python3

须藤百胜安装python36.x86_64 python36-tools.x86_64

$ python3-版本Python 3.6.8

$ pip -V pip 9.0.3来自/usr/lib/python2.7/dist-packages(python 2.7)

] $ sudo python3.6 -m pip install –upgrade pip收集pip下载https://files.pythonhosted.org/packages/d8/f3/413bab4ff08e1fc4828dfc59996d721917df8e8583ea85385d51125dceff/pip-19.0.3-py2.py3-none-any.whl(1.4MB)100%|█████████████████████████████████| 1.4MB 969kB / s安装收集的软件包:pip找到现有安装:pip 9.0.3卸载pip-9.0.3:成功卸载pip-9.0.3成功安装pip-19.0.3

$ pip -V pip 19.0.3来自/usr/local/lib/python3.6/site-packages/pip(python 3.6)

This what worked for me on Amazon Linux

sudo yum list | grep python3

sudo yum install python36.x86_64 python36-tools.x86_64

$ python3 –version Python 3.6.8

$ pip -V pip 9.0.3 from /usr/lib/python2.7/dist-packages (python 2.7)

]$ sudo python3.6 -m pip install –upgrade pip Collecting pip Downloading https://files.pythonhosted.org/packages/d8/f3/413bab4ff08e1fc4828dfc59996d721917df8e8583ea85385d51125dceff/pip-19.0.3-py2.py3-none-any.whl (1.4MB) 100% |████████████████████████████████| 1.4MB 969kB/s Installing collected packages: pip Found existing installation: pip 9.0.3 Uninstalling pip-9.0.3: Successfully uninstalled pip-9.0.3 Successfully installed pip-19.0.3

$ pip -V pip 19.0.3 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)


回答 13

对于python3,应该是pip3

在ubuntu上

sudo apt install python3-pip

For python3 it should be pip3

on ubuntu

sudo apt install python3-pip

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。