Several issues arose with installing the third-party tool pandas for Python.
When I enter pip install pandas in the cmd command environment to prepare for the installation of pandas, there is an error message: Microsoft Visual C++ 9.0 is required. from the online information there is the following solution:
1. Download and install Visual Studio, and set the environment variables, different versions of VS need to set different values of the environment variables
Visual Studio 2010 (VS10) set VS90COMNTOOLS=%VS100COMNTOOLS%
Visual Studio 2012 (VS11) Setting VS90COMNTOOLS=%VS110COMNTOOLS%
Visual Studio 2013 (VS12) Setting VS90COMNTOOLS=%VS120COMNTOOLS%
For Python 2.7 it is recommended to install vs2008.
Since the first method requires configuring environment variables, it seems cumbersome. So I chose the second option as below:
2. In the URL: /en-us/download/?id=44266 directly download Microsoft Visual C++ Compiler for python2.7 and install it. Note: In the process of installing pandas may wait for a long time, you can wait patiently. Don't think that there is an error in the installation process and uninstall numpy or something like that. Wait 7,8 minutes after the pandas will be prompted to install successfully, at this time you can successfully import the pandas library:
3. Directly from the Internet to download pandas exe file can be installed, after successful installation in the cmd command environment, enter pip install pandas command can be successfully installed pandas
4. Download the binary installation file corresponding to your Python version from the website: /~gohlke/pythonlibs/ (the file with whl suffix, both 32-bit and 64-bit), and then execute the pip install whl file in the cmd command environment to install python (e.g. pip install F:\\). install\python\numpy-1.9.2+mkl-cp27-none-win_amd64.whl) command to install pandas, but after installing pandas in this way, you may also need to install other third-party libraries associated with pandas, you can directly use the pip tool to install.
5.mountingpandasProblems after the package。mounting成功后,import pandas,The following error occursValueError: has the wrong size, try recompiling. Expected 52, got 56
This needs to upgrade your numpy package, I directly upgrade, easy_install --upgrade numpy error, test twice are failed. Then I uninstalled numpy, then reinstalled numpy.
pip uninstall numpy pip intsall numpy
And so on, and the installation was successful.
6. Continue to test, import pandas, and again appeared
AttributeError: 'unicode' object has no attribute 'version'
After checking in *, it said it was the version of my matplotlib, so I upgraded to the latest matplotlib,pip intsall -U matplotlib, after the upgrade was successful, and then I imported pandas, and it worked.
The several methods summarized above basically apply to the installation of other third-party libraries for Python as well. I hope it will be helpful to you, and I hope you will support me more.