Use PIP to install NumPy library problem Rollup

Source: Internet
Author: User

Both Easy_install and Pip are used to download the management tools for installing the related resource bundles for the pypi of a common repository of Python, while the PIP is a easy_install version that provides better hints and removes package features. The Python official web-compiled MSI file already contains both tools, installed in the <python installation directory >/lib/site-packages file.

The system environment is Win7 (64bit) +python2.7.10 (64bit) +vs2010, where the problems and solutions that occur during the use of PIP installation NumPy are recorded. 1 Unable to find Vcvarsall.bat

Open PowerShell, (in advance, import Python and Python script directories into the environment variable path), and enter:

pip Install NumPy

Error occurred:

Setup script exited with error:unable to Findvcvarsall.bat
"Cause analysis"

Setupscript exited with error:unable to find Vcvarsall.batthepython package being installed the source code for A native extensionmodule (. PYD), but does not have a pre-built copy of the module. Thepython packages highlighted at pythonwheels.com have already been updated through Theirdevelopers to include pre-built Binar IES, but many are still only available code. (from Microsoft website)

The code that needs to be compiled uses C's code, and the package's code is released without being precompiled into Python binaries, so the modules need to be compiled using C complier during installation. Under Windows, Python's setup.py requires the support of visual Studio2008. "Workaround"

(1) If you have a higher version of VS on your machine, you can let Python use the newer version of VS to support the installation in the following way.

If you have Visual Studio 2010 installed on your machine, you can perform the following command before performing PIP install:

SET vs90comntools=%vs100comntools%

If you install VisualStudio2012, you can execute the following command:

SET vs90comntools=%vs110comntools%

If you install the VS version 2013, you can use the following command:

SET vs90comntools=%vs120comntools%

(2) If you do not have a Microsoft VS environment, you can install Microsoft Visual C + + Compiler for Python 2.7. 2 cannot link a simple C program

Issue 1 After the installation process continues, an error occurs:

Runtimeerror:broken toolchain:cannot link asimple C Program

"Workaround"

The msvc9compiler.py file in the path%pythonhome%lib\distutils (default is C:\Python27\Lib\distutils) is approximately 661 lines, as the following illustration modifies:


Re-enter command

Pip Install NumPy

Installation success:


"References"

Http://www.tuicool.com/articles/JzI3Uj

http://blog.csdn.net/yanqiangsdu/article/details/43166951

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.