Summary when Python 3.5.1 + numpy + scipy + α is installed in Windows environment (Written by a person for about a week for the first time in Python)
OS Windows 10 Pro (64 bit)
Python 3.5.1 (32 bit)
wheel (0.29.0) numpy (1.10.4) scipy (0.17.0) pandas (0.17.1) matplotlib (1.5.1) scikit-learn (0.17)
python
C:\Users\ktanaka>python
Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:38:48) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
C:\Users\ktanaka>
The package management tool pip is installed by default from Python 3.4. Upgrade pip by running the following command from the command prompt
python
C:\Users\ktanaka>python -m pip install --upgrade pip
Collecting pip
Downloading pip-8.0.2-py2.py3-none-any.whl (1.2MB)
100% |################################| 1.2MB 227kB/s
Installing collected packages: pip
Found existing installation: pip 7.1.2
Uninstalling pip-7.1.2:
Successfully uninstalled pip-7.1.2
Successfully installed pip-8.0.2
C:\Users\ktanaka>
In the following explanation,
python
C:\Users\ktanaka>python -m pip install --upgrade pip
Execution from a command prompt like
python
python -m pip install --upgrade pip
And omit the log. If there is a notation starting with python -m, it means execution from the command prompt.
I think I read somewhere that the mechanism for installing .whl files containing binaries with pip ...
python
python -m pip install wheel
numpy and scipy call the math library internally. Therefore, it is necessary to associate the binary of the numerical calculation library with numpy and scipy. I tried various things this time, but I had a hard time installing scipy. It seems that scipy is related to numpy, so I will explain it with failure cases in my environment including installation of numpy.
Numpy with pip,Normal installation of scipy
python -m pip install numpy
python -m pip install scipy
Looking at the log, it seems that the installation process of numpy and scipy is as follows.
numpy
Check if the Numerical Library is installed in your environment
Installed
Install numpy in association with the installed Numerical Library
Not installed
Check if a compiler such as Visual Studio is installed
Installed
Generate a binary of the numerical operation library using a compiler and install numpy in association with the generated binary.
Not installed
Installation failure
scipy
Check if the Numerical Library is installed in your environment
Installed
Install scipy in association with the installed Numerical Library
Not installed
Installation failure
As for numpy, my environment is "Numerical calculation library is not installed" "Visual Studio 2015 is installed" After a lot of compilation by Visual Studio 2015, the installation was successful.
It failed for scipy. The installation process "Similar to numpy, the source code is enclosed and processing such as generating binaries in Visual Studio 2015 runs" Or "Associate with binaries created with numpy" I was happy if it was, but it didn't happen and it ended with an error.
At the stage of 2016/02/17, I gave up because there was no one corresponding to Python 3.5.1. https://sourceforge.net/p/numpy/activity/ https://sourceforge.net/p/scipy/activity/
I finally installed it this way.
Compiled binaries are included.pip installation using whl file
python -m pip install C:\Users\ktanaka\Downloads\numpy-1.10.4+mkl-cp35-none-win32.whl
python -m pip install C:\Users\ktanaka\Downloads\scipy-0.17.0-cp35-none-win32.whl
This way, the installation and sample script execution was successful.
When I installed with the following combination, the installation succeeded, but an error occurred when executing the script.
Compiled binaries are included.pip installation using whl file
python -m pip install numpy
python -m pip install C:\Users\ktanaka\Downloads\scipy-0.17.0-cp35-none-win32.whl
Python script executed
from scipy import stats
Details of the error
・ ・ ・
from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.
It seems that it is necessary to install so that the same math library is referenced by numpy and scipy, and the description of the distribution site also says "The distributed binary (.whl) is in numpy + mkl (Intel Math Kernel Library) It depends on it, "so I succeeded in installing it using .whl of numpy distributed on the same site.
Many binaries depend on NumPy-1.10+MKL and the Microsoft Visual C++ 2008 (x64, x86, and SP1 for CPython 2.6 and 2.7), Visual C++ 2010 (x64, x86, for CPython 3.3 and 3.4), or the Visual C++ 2015 (x64 and x86 for CPython 3.5) redistributable packages.
I installed the following packages. pandas (0.17.1) matplotlib (1.5.1) scikit-learn (0.17)
python
python -m pip install pandas
python -m pip install matplotlib
python -m pip install scikit-learn
pip convenient
In building a Python development environment on Windows
――Anaconda, which has various packages from the beginning, is convenient --Python installation on Windows is difficult
I was listening to the prior information
--I want to install with the minimum configuration --I want to understand things around Python package management --When I joined http://qiita-kobito-team-meetup14.peatix.com/, I heard that the Atom editor is amazing, so I want to use it: D --It seems that pip etc. are implemented as standard and the installation work is much easier.
I tried to install it for such a reason. Considering the update of numpy and scipy, I think it would be better to install the numerical calculation library separately and install it with normal pip. (I'm not sure if that method works) I'll try it when I have time.
Now I'm adding the script package to the Atom editor and running it with Ctrl + Shift + B. However, Anaconda is convenient because you can execute only the selected line. If anyone knows a package that can execute selected lines with the Atom editor package, please let me know _ (._.) _
Under arrangement
Recommended Posts