MacBookPro encounters pip: command not found problem solving

When learning Pyhton, you need to install the third-party plug-in pyecharts, execute the following command:

pip install pyecharts

Always report an error pip: command not found

If I can't install pyecharts, I can't continue to study. I am very depressed, so I searched online and tried various commands, hoping to solve it. After reading more than a dozen articles, I tried some of the following commands and tried them one by one. Either an error or a warning was reported, but it didn’t work.
Command 1: curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
Command 2: sudo easy_install pip

I was about to give up, and then I saw an article saying that if the python3 version is installed, then theoretically there is pip, and you can check it with the following command.

python3 -m pip -V

I installed the python3.11 version, so I ran the above command in the terminal to check, and the result showed
pip 22.3.1 from /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ pip (python 3.11)
is shown in the figure below:
pip version
This means that pip has been installed, and the version is still 22.3.1. What is puzzling is why it still shows pip: command not found? One sentence in the article reminded me.
It turns out that the Python2 version uses the pip command, and the Python3 version uses the pip3 command .
In other words, just write pip as pip3, it's that simple.

 pip3 install pyecharts

I tried it, and sure enough, pyecharts was installed successfully.
insert image description here
insert image description here

Just such a small matter, I have been tossing all afternoon, trying various things. Fortunately, the results are good, and finally found the reason, you can install third-party plug-ins.
I hope this article can help beginners who encounter the same problem as me.

Guess you like

Origin blog.csdn.net/wangyining070205/article/details/128605118