Proper way to install pip on Ubuntu

2020-05-18 05:35发布

I'm trying to install the latest version of pip (currently 8.1.2) on the official ubuntu/trusty64 Vagrant box. The box comes with Python 2.7.6 and 3.4.3 pre-installed with apt-get.

I read the pip installation doc and it contains the following warning:

Be cautious if you're using a Python install that's managed by your operating system or another package manager. get-pip.py does not coordinate with those tools, and may leave your system in an inconsistent state.

Does that mean I cannot install pip using get-pip.py and I am limited to install an older version of it from apt-get?

If there is a better way of installing it, what would it be?

Thanks

标签: python pip
7条回答
相关推荐>>
2楼-- · 2020-05-18 06:11

Try download install package from https://pypi.python.org/pypi/pip#downloads and use python setup.py install

查看更多
走好不送
3楼-- · 2020-05-18 06:14

If you are using Ubuntu OS with Python2.7 You can follow below steps

apt-get update

apt-get upgrade

apt-get install python-pip

To check install pip version

pip --version

OR

If you are using Ubuntu OS with Python3 You can follow below steps

apt-get update

apt-get upgrade

apt-get install python3-pip

To check install pip3 version

pip3 --version

查看更多
beautiful°
4楼-- · 2020-05-18 06:14

This worked for me on ubuntu 18.0.4:

1- sudo apt-get update
2- sudo apt-get upgrade
3- sudo apt-get install python-pip
4- pip -V
查看更多
我命由我不由天
5楼-- · 2020-05-18 06:25

if it is outdated you can use the following command: sudo pip install --upgrade pip

查看更多
beautiful°
6楼-- · 2020-05-18 06:26

I believe that you can install it on Ubuntu with

sudo apt-get install python-pip

or

sudo apt-get install python3-pip

for Python 3. Sure, it's an older version but its functionality is there.

查看更多
该账号已被封号
7楼-- · 2020-05-18 06:31

The proper commands to install pip and pip3 should be the following:

sudo apt-get install python-pip python3-pip --yes
sudo python3 -m pip install pip --upgrade --force-reinstall
sudo python -m pip install pip --upgrade --force-reinstall # this must come after upgrading pip3

The last two lines get pip3 and pip up-to-date. The last line is critical because it re-associates pip with python 2.

查看更多
登录 后发表回答