Python Configuration third-party libraries NumPy and Matplotlib's Winding Road

Source: Internet
Author: User
Tags win32 installer install matplotlib

I am a 64-bit system, Python novice, spent nearly a night to NumPy and Matplotlib reluctantly configured successfully, now this tortuous experience recorded as follows:

First step: Install Python

Download 32-bit python from the Python website. Python:

Here the reason to download 32-bit Python, because I previously installed 64-bit Python, in the loading of third-party modules, a variety of unsuccessful, Baidu a bit everyone said that the direct pip install is OK, but has failed, so this is the worst way, However, the 64-bit Windows system supports 32-bit python. , in fact, there is an important reason to choose 32-bit Python here: You can easily find the NumPy module in the Win32 platform EXE version of the installation files, so as to avoid the installation of WHL files, I finally choose to install 32-bit python3.4.1.

Step two: Update the PIP tool

After installation of Python is complete, first add the path to the environment variable so that you can invoke the PIP command directly in the cmd window:

One thing to emphasize is that Python installs the PIP tool by default at the point of installation, but its version is not necessarily up to date, so if we want to install the Python third-party library through the PIP tool, we first need to update it to the latest version, simply by typing in the cmd window " pip  install --upgrade pip "command. But I'm using Pycharm as the IDE for Python, so I've finished updating the PIP version with Pycharm:

Select the corresponding module in the left-hand list, click on the right of the upward arrow to complete the corresponding version update, of course, its principle is also back in the background calls the upgrade command, Pycharm This small function is quite convenient.

Step three: Manually install the Numpy.exe file

After updating Pip, of course we first thought of the NumPy module was added via Pip, but when I entered "Pip Install NumPy", DOS was stuck in this interface for 10,000 years and then made an error:

Then I try to manually now numpy the WHL installation file, direct PIP installation file. WHL, or failed.

So I hope to find NumPy exe version of the installation files to once and for all, cost Dickens, finally found:

:, I installed here 1.9.1, of course, can also install the latest 1.10.1, after the download is complete, double-click the installation, the exception is convenient. The observation found that only the Win32 installer is here, which is why we installed the 32-bit python before.

Fourth step: Install the Matplotlib library

After the installation of NumPy in the installation of matplotlib is very simple, directly in the cmd window input "pip install Matplotlib", Pip will automatically detect, download and install all components, very convenient.

In short, if the 64-bit system installation (PIP installation WHL file) failed, then please use 32 bit python, because you can find the 32-bit EXE version of the installation files, this is not an opportunistic?

Fifth step: Install the Pygame module

After the configuration, I still have a question, is why the PIP installation WHL file will fail? The preliminary inference is the path problem, so I try to manually install the Pygame (a module of game development) This third-party module to confirm their inference.

First, download the WHL file for Pygame:

I downloaded directly to the desktop by default, and then called the PIP tool to install, sure enough, the program error:

The program is very clear, unable to find the file, one time we consider to put the WHL file in the C packing directory, and then through the CMD into the C disk to start the file:

The installation was successful (because I have previously installed Pygame, the system is not prompted again).

Sixth Step: summary

Tossing all night, for Python to configure third-party libraries there are a few experiences:

(1) preferred "Pip Install name" for automatic installation

(2) If the automatic installation fails, then manually download the corresponding WHL file, with "Pip install" to install, it is important to pay attention to the problem of the path.

(3) still failed, then go to sourceforge download the corresponding EXE version, this situation requires users to install 32-bit Python, because SourceForge seemingly only 32-bit EXE file.

Python Configuration third-party libraries NumPy and Matplotlib's Winding Road

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.