Ubuntu16.04 install and uninstall pip Experimental environment Ubuntu 16.04; VMware 15; Problem Description I installed Ubuntu 16.04 on a virtual machine. After a while, I reopened it and prepared to compile a python program. When installing the required packages, I found that pip pip3 all pointed to python 2.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) After searching online and reading various tutorials, I still cannot get pip3 to link to python3. The final solution to the problem was an accidental result after spending time. Problem Solving The solution most often mentioned in online tutorials is: Install pip Upgrade pip uninstall Generally, this will default pip3 to python3, but it doesn't solve my problem. You can try it, maybe it can solve your problem. If not, read on. What actually solved my problem: Install pip3 Use the following statement to install. If you want to configure pip3 for the system's built-in python3.5, just execute curl https://bootstrap.pypa.io/get-pip.py | sudo python3.6. After execution, if pip points to python3.5, we only need to execute curl https://bootstrap.pypa.io/get-pip.py | sudo python2.7 again. # Check 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 After finishing, 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) It was just a small problem, but it took me a long time to record it. To avoid some exceptions, it is recommended not to modify the system's built-in Python environment Summarize The above is the Python virtual environment installation and uninstallation method and problems encountered introduced by the editor. I hope it will be helpful to everyone! You may also be interested in:
|
<<: In-depth understanding of MySQL global locks and table locks
>>: Basic Implementation of AOP Programming in JavaScript
Difference between HTML and XHTML 1. XHTML elemen...
Index merging is an intelligent algorithm provide...
Table of contents 1. child_process 2. Command exe...
1. Create a database: create data data _name; Two...
Non-orthogonal margins When margin is used, it wi...
Talk about the scene Send Email Embedding HTML in...
Preface Recently, I was working on a report funct...
Configure Mysql master-slave service implementati...
Table of contents Class Component Functional Comp...
If you are using the latest Ubuntu Server version...
Learned ConcurrentHashMap but don’t know how to a...
Simply put, delayed replication is to set a fixed...
I collected a lot of them, but all ended in failu...
The default firewall of CentOS7 is not iptables, ...
Managing disk space is an important daily task fo...