python virtual environment Install and Uninstall

Ubuntu16.04 install uninstall pip
original Solarzhou Posted on 2019-06-12 21:50:28 Reads 2001 collection
launched

Experimental environment
Ubuntu16.04; VMware15;

Problem Description
I Ubuntu16.04 installed on a virtual machine, ready to re-open the program to compile python after some time, found that when you install the required packages, pip pip3, points are python2.7;

hadoop@ubuntu:~$ pip3.5 -V
pip 19.1.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
hadoop@ubuntu:~$ pip -V
pip 19.1.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

1
2
3
4
5
online search, a search of a variety of tutorials still can not get pip3 link to python3. The last chance to solve the problem belongs to the result of time-consuming.

Problem Solving
1
online tutorials most frequently mentioned solution is:

Installation PIP
sudo install APT-GET-PIP python3

Upgrade PIP
sudo install --upgrade PIP PIP3

Uninstall
sudo apt-get remove python3-pip

Doing things like this are usually the default pip3 point python3, but could not solve my problem. You can try, maybe you can solve your problem, then look down to die.

2
real way to solve my problem:

Installation pip3
use the following statement to install, if you want to configure pip3 system comes with python3.5, simply execute curl https://bootstrap.pypa.io/get-pip.py | sudo python3.6. After you do if pip point python3.5; we just need to execute curl https://bootstrap.pypa.io/get-pip.py again | sudo python2.7 can be.
# Check for and install python3.6
sudo APT-GET Update
sudo APT-GET install python3.6
curl https://bootstrap.pypa.io/get-pip.py | sudo python3.6
1
2
3
4
When done to verify the pip version:

hadoop@ubuntu:~$ pip3.5 -V
pip 19.1.1 from /usr/local/lib/python3.5/dist-packages/pip (python 3.5)
hadoop@ubuntu:~$ pip -V
pip 19.1.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

1
2
3
4
5
a little small problem, but also spent waited a long time to record.
To avoid some unusual, it is recommended not to modify the system comes with python environment
----------------
Disclaimer: This article is the original article CSDN bloggers "Solarzhou", and follow CC 4.0 BY- SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/ZT7524/article/details/91633030

Guess you like

Origin www.cnblogs.com/6zdk/p/12068696.html