help install numpy and scipy in window 7 and 3.5.0 shell

Oscar Benjamin oscar.j.benjamin at gmail.com
Fri Apr 15 17:23:23 EDT 2016


On 15 April 2016 at 17:29,  <wrh8609 at gmail.com> wrote:
>> On Apr 15, 2016 10:40 AM, <wrh8609 at gmail.com> wrote:
>> >
>> > I have downloaded the numpy-1.11.01 and scipy-0.17.0 but after running
>> setup files over IDLE in numpy and scipy, it still can not get through. Can
>> someone give me a hand? or you can provide the installation instruction for
>>
>
> First I would like to have your input of installation instruction for numpy and scipy. I don't know what I did to run the setup.py is correct. The operating system is on window 7 and the version of python is 3.5.0. By the way, after I ran the setup.py of numpy over IDLE, it shows "Running from numpy source directory."

I think what you mean is that you ran the setup.py to build e.g
"python setup.py biuld" and then you ran Python and did "import numpy"
and then numpy complained about you importing from within the source
directory. Numpy complains about this because you should *install*
numpy, change to a different directory and then import it e.g.:

$ python setup.py install
$ cd /some/where/else
$ python
>>> import numpy

> and I can import numpy. But after I ran setup.py of scipy over IDLE, it shows
> =============== RESTART: C:\PythonFiles\scipy-0.17.0\setup.py ===============
> Traceback (most recent call last):
>   File "C:\PythonFiles\scipy-0.17.0\setup.py", line 265, in <module>
>     setup_package()
>   File "C:\PythonFiles\scipy-0.17.0\setup.py", line 253, in setup_package
>     from numpy.distutils.core import setup
> ImportError: No module named 'numpy'

You didn't install numpy so it's not importable when you're not in the
numpy source directory. In order to build scipy you have used cd to
change to a different directory and now "import numpy" (which is what
scipy's setup.py does) fails.

I'm not sure what toolchain you can actually use to build numpy and
scipy for Python 3.5 on Windows because:
1) In the past (Pre 3.5) MinGW gcc was used to be able to compile the
fortran parts of scipy.
2) python.org's Python 3.5 Windows build is updated to use MSVC2015
which uses the new UCRT.
3) MinGW gcc cannot make binaries compatible with the UCRT so...
4) MSVC2015 is needed for extension modules for Python 3.5 on Windows but...
5) MSVC2015 cannot compile Fortran so it can't compile scipy

There is work on a project called mingwpy which will hopefully add
ucrt support to MinGW-W64 but I'm not sure of its status.

All of the above is just background on the difficulties of building
numpy/scipy yourself for Python 3.5 on Windows however...

Numpy now has binary (pre-complied) wheels for Windows, OSX and Linux
on PyPI so you should be able to just install it with:

    $ pip install numpy

This is much easier than what you're currently attempting. I don't
know if the same works for scipy now or not.

Here on Linux I can install both numpy and scipy as precompiled wheels
from PyPI simply by running

    $ pip install numpy scipy

and it takes about 5 seconds.

Give it a try and let and us know.

--
Oscar



More information about the Python-list mailing list