The solution that the pip command cannot be used after installing python on the mac system

Pro-test is useful: (the following are two versions)

One, python2.7 version

The mac operating system comes with a version of python2.7, but it does not have idle, pythonLauncher, pip and other accompanying tools, and you need to download and install it yourself. Use the shortcut key Command+Space to open the global search button and enter the terminal, then click the application option under the result to open it to enter the command line, and execute the following command:

sudo easy_install pip

The above operation is to use the easy_install software and package management tool to download and install the pip tool that conforms to the current default python version from the mirror source. After the installation is complete, you can use the pip -version command to check that it can be used normally.

Two, python3.x version

The other one is currently the most mainstream python3.x version, which needs to be downloaded and installed on the mac system. When it is installed, it generally has its own pip tool by default. If it does not, it will cancel the installation of the default program and tools.

Then at this time, enter the terminal command line window through the same method, and then use the curl tool to visit the official website of pypi to download and install the pip tool. After the installation is complete, you need to execute the update command to upgrade it to the current python3 version. The command is as follows:

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

Guess you like

Origin blog.csdn.net/ONLYSRY/article/details/129622465