Last update at :2024-06-02,Edit by888u
1. Install pip for Python 2
First, make sure you have Python 2 installed. On Ubuntu, you can verify using the following command
python2 --version
If there are no errors and valid output for the Python version is displayed, Python 2 is installed. So now you can install pip for Python 2 using this command:
sudo apt install python-pip
This will install pip and many of its other dependencies. After the installation is complete, please confirm that you have installed pip correctly.
pip --version
It should display a version number like this:
pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)
This means you have successfully installed pip on Ubuntu.
2. Install pip for Python 3
You must ensure that Python 3 is installed on Ubuntu. You can check it using the following command:
python3 --version
If a number like Python 3.6.6 is displayed, Python 3 is installed on your Linux system.
Now, you can install pip3 using the following command:
sudo apt install python3-pip
You should verify that pip3 is installed correctly using the following command:
pip3 --version
It should display a number like this:
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
This means that pip3 has been successfully installed on your system.
Summary
The above is the method of installing pip on Ubuntu introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time!
Recommended site searches: domain name space agency, international domain name, cn domain name registration, free mainland China space, foreign php host, Guangzhou host rental, server hosting price, mainland China domain name, online server website, Hong Kong host high defense,
p>
发表评论