Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How Python installs matplotlib from the command prompt

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how Python installs matplotlib through the command prompt, I believe most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to know it!

Python installs matplotlib from the command prompt:

1. Open the command prompt directly (shortcut key window + r)

two。 If prompted that the installation failed (Python-you are using pip version 9.0.1, but version 10.0.1 is available. ), enter python-m pip install-U pip setuptools to upgrade. If the installation is successful, the following figure shows:

three. After the installation is successful, type python-m pip install matplotlib to install automatically, and the system will download the installation package automatically. Normally, pip downloads the associated installation package to complete the final installation. The following is a screenshot of the download:

4. After the installation is complete, you can type python-m pip list to view all packages installed by Python and see if matplotlib is installed.

The interface displayed is:

If you find matplotlib, you have successfully installed:

5. You can check whether matplotlib is successfully installed in Python IDLE. The installed package import will not report an error, while the uninstalled package import will report an error. If pandas is not installed here, enter import pandas and import matplotlib respectively and enter enter. As a result

As shown in the figure:

Importing pandas reported an error, while importing matplotlib did not report an error.

At this point, the matplotlib installation is successful!

Another method (offline installation):

Go to the website to download the Matplotlib library file, to match the local Python version, if it is the Python 3.8.x version, select "matplotlib-3.3.0-cp38-cp38-win_amd64.whl", the keyword is "CP", amd64 is the local Windows version digits, here is 64-bit Windows. Similarly, "macosx" is the Apple version and "manylinux1" is the Linux version. The version must be matched well, otherwise the installation will not be successful.

Step1, enter the CMD interface, and enter the save path of the downloaded file.

Step2, run command: "absolute path saved by pip install download file"

Step3, wait for the decompression, and run "pip list" to see if the library file is in the list, and if so, OK!

The interpreter of Step4 and Pycharm had better choose "System Interpreter". All three installed libraries have been installed and can be referenced.

The above is all the contents of the article "how Python installs matplotlib from the command prompt". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report