After reading this article, mom no longer has to worry about my python numpy module installation will fail

This article mainly introduces the summary of simple solutions to the unsuccessful installation of python's numpy module, and shares four solutions to the unsuccessful import of python modules, which have certain reference value, and friends who need it can refer to it.

In order to draw a picture, the installation of the numpy module is really crazy! ! ! I have been unable to install it. After spending several hours, I read many tutorials and methods on the Internet and found that the summary is not very complete. Here is a summary to prevent everyone from recurring this problem and there is no solution.

One of the charms of Python is that it has many powerful plug-ins, but finding, installing, and upgrading these plug-ins is very troublesome on the windows system. First, after installing Python, you need to configure environment variables in the system, and then you need to install Setuptools, and coding errors will be reported during the installation process. For those who need to copy the source code to install, you need to go to the CMD to type commands, and you must be careful to avoid typing wrong parameters. , If there is no experienced person around to give pointers, installing, upgrading, and uninstalling plug-ins are big problems!

Environment introduction, python2.7.2, win7, VS2010.

method one:

1. First choose easy_installnumpy, installation error: Unabletofindvcvarsall.bat

2. Go to https://sourceforge.net/projects/numpy/files/NumPy/ to manually download the installation package, choose zip for windows system, and tar.gz for unix systems. After downloading, unzip, enter the folder under the system command line, execute pythonsetup.pyinstall, but the installation still reports an error: the general situation is: error: Unabletofindvcvarsall.bat, roughly means that MicrosoftVC++9.0 is missing, which may be your computer The higher version of VS is installed, and it needs VS2008 to support it, so an error is reported.

The possible solutions are:

If VisualStudio2010 is installed on your machine, you can execute the following command before executing easy_install:

SETVS90COMNTOOLS=%VS100COMNTOOLS%

If you have installed VisualStudio2012, you can execute the following command:

SETVS90COMNTOOLS=%VS110COMNTOOLS%

If the version of VS you installed is 2013, you can use the following command:

SETVS90COMNTOOLS=%VS120COMNTOOLS%

It may not be successful, but you can give it a try~

Method Two:

See clearly to choose the whl file according to your python version and the bit number of your computer. In order to be able to install the whl file, you need to install the whl package first. Enter into cmd and enter

pip install wheel

After the installation is successful, download the corresponding numpy wheel file and move it to the local file storage place in cmd. Then type



pip install numpy‑1.9.2+mkl‑cp27‑none‑win_amd64.whl
 

The last part of the above statement is the file name. According to the description of your problem, you should download this file and press Enter to automatically install it.

This is also how to install .whl files for python.

Method three:

Install Anaconda: AnacondaScientificPythonDistribution, many scientific computing libraries have been integrated (not only numpy, but also sklearn, pandas, etc.). Both python2.7 and python3.4.

You can also install the python(x,y) software directly, which contains almost all python libraries and many practical tools, and the installation success rate is very high.

This method can directly solve your current drawing problem.

Method four:

I found that under the Windows platform, it is very convenient to use PyCharm to manage the plug-in. There is no need to type commands at all, just click with the mouse, which is very convenient.

First open the project project, open the toolbar file ---- find the settings, open

Find the plus sign and minus sign to the right of project_interpreter to manage each module, click the plus sign.

Search numpy, click InstallPackage, you can install it, and ensure the network is unblocked! ! Just wait~~

Among the above four methods, the first two may be unsuccessful, the third is to change the place to solve the problem, and the fourth is to install the pycharm software in advance if there is no Pycharm.

Personally suggest the fourth option, which can eliminate the installation problems of various modules in the future, which is a once and for all method! !

to sum up

The above is the summary of the simple solution for the unsuccessful installation of python's numpy module in this article. I hope it will be helpful to everyone.

I am a python development engineer, and I have compiled a set of the latest python system learning tutorials, including basic python scripts to web development, crawlers, data analysis, data visualization, machine learning, and interview books. Those who want these materials can pay attention to the editor, add Q skirt 851211580 to pick up Python learning materials and learning videos, and online guidance from the Great God!

 

Guess you like

Origin blog.csdn.net/pyjishu/article/details/105434573