How do I install SciPy on 64 bit Windows?

130,632

Solution 1

I haven't tried it, but you may want to download this version of Portable Python. It comes with Scipy-0.7.0b1 running on Python 2.5.4.

Solution 2

Unofficial 64-bit installers for NumPy and SciPy are available at http://www.lfd.uci.edu/~gohlke/pythonlibs/

Make sure that you download & install the packages (aka. wheels) that match your CPython version and bitness (ie. cp35 = Python v3.5; win_amd64 = x86_64).

You'll want to install NumPy first; From a CMD prompt with administrator privileges for a system-wide (aka. Program Files) install:

C:\>pip install numpy‑<version>+mkl‑cp<ver-spec>‑cp<ver-spec>m‑<cpu-build>.whl

Or include the --user flag to install to the current user's application folder (Typically %APPDATA%\Python on Windows) from a non-admin CMD prompt:

C:\>pip install --user numpy‑<version>+mkl‑cp<ver-spec>‑cp<ver-spec>m‑<cpu-build>.whl

Then do the same for SciPy:

C:\>pip install [--user] scipy‑<version>‑cp<ver-spec>‑cp<ver-spec>m‑<cpu-build>.whl

Don't forget to replace <version>, <ver-spec>, and <cpu-build> appropriately if you copy & paste any of these examples. And also that you must use the numpy & scipy packages from the ifd.uci.edu link above (or else you will get errors if you try to mix & match incompatible packages -- uninstall any conflicting packages first [ie. pip list]).

Solution 3

Short answer: Windows 64 bit support is still work in progress at this time. The superpack will certainly not work on a 64-bits Python (but it should work fine on a 32 bits Python, even on Windows 64 bit).

The main issue with Windows 64 bit is that building with mingw-w64 is not stable at this point: it may be our's (NumPy developers) fault, Python's fault or mingw-w64. Most likely a combination of all those :). So you have to use proprietary compilers: anything other than the Microsoft compiler crashes NumPy randomly; for the Fortran compiler, ifort is the one to use. As of today, both NumPy and SciPy source code can be compiled with Visual Studio 2008 and ifort (all tests passing), but building it is still quite a pain, and not well supported by the NumPy build infrastructure.

Solution 4

As the transcript for SciPy told you, SciPy isn't really supposed to work on Win64:

Warning: Windows 64 bits support is experimental, and only available for
testing. You are advised not to use it for production.

So I would suggest to install the 32-bit version of Python, and stop attempting to build SciPy yourself. If you still want to try anyway, you first need to compile BLAS and LAPACK, as PiotrLegnica says. See the transcript for the places where it was looking for compiled versions of these libraries.

Solution 5

WinPython is an open-source distribution that has 64-bit NumPy and SciPy.

Share:
130,632
Peter Mortensen
Author by

Peter Mortensen

Experienced application developer. Software Engineer. M.Sc.E.E. C++ (10 years), software engineering, .NET/C#/VB.NET (12 years), usability testing, Perl, scientific computing, Python, Windows/Macintosh/Linux, Z80 assembly, CAN bus/CANopen. Contact I can be contacted through this reCAPTCHA (requires JavaScript to be allowed from google.com and possibly other(s)). Make sure to make the subject specific (I said: specific. Repeat: specific subject required). I can not stress this enough - 90% of you can not compose a specific subject, but instead use some generic subject. Use a specific subject, damn it! You still don't get it. It can't be that difficult to provide a specific subject to an email instead of a generic one. For example, including meta content like "quick question" is unhelpful. Concentrate on the actual subject. Did I say specific? I think I did. Let me repeat it just in case: use a specific subject in your email (otherwise it will no be opened at all). Selected questions, etc.: End-of-line identifier in VB.NET? How can I determine if a .NET assembly was built for x86 or x64? C++ reference - sample memmove The difference between + and &amp; for joining strings in VB.NET Some of my other accounts: Careers. [/]. Super User (SU). [/]. Other My 15 minutes of fame on Super User My 15 minutes of fame in Denmark Blog. Sample: Jump the shark. LinkedIn @PeterMortensen (Twitter) Quora GitHub Full jump page (Last updated 2021-11-25)

Updated on July 08, 2022

Comments

  • Peter Mortensen
    Peter Mortensen almost 2 years

    How do I install SciPy on my system?

    For the NumPy part (that SciPy depends on) there is actually an installer for 64 bit Windows: numpy-1.3.0.win-amd64-py2.6.msi (is direct download URL, 2310144 bytes).

    Running the SciPy superpack installer results in this message in a dialog box:

    Cannot install. Python version 2.6 required, which was not found in the registry.

    I already have Python 2.6.2 installed (and a working Django installation in it), but I don't know about any Registry story.

    The registry entries seem to already exist:

    REGEDIT4
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Python]
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore]
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.6]
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.6\Help]
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.6\Help\Main Python Documentation]
    @="D:\\Python262\\Doc\\python262.chm"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.6\InstallPath]
    @="D:\\Python262\\"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.6\InstallPath\InstallGroup]
    @="Python 2.6"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.6\Modules]
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.6\PythonPath]
    @="D:\\Python262\\Lib;D:\\Python262\\DLLs;D:\\Python262\\Lib\\lib-tk"
    

    What I have done so far:

    Step 1

    Downloaded the NumPy superpack installer numpy-1.3.0rc2-win32-superpack-python2.6.exe (direct download URL, 4782592 bytes). Running this installer resulted in the same message, "Cannot install. Python version 2.6 required, which was not found in the registry.". Update: there is actually an installer for NumPy that works - see beginning of the question.

    Step 2

    Tried to install NumPy in another way. Downloaded the zip package numpy-1.3.0rc2.zip (direct download URL, 2404011 bytes), extracted the zip file in a normal way to a temporary directory, D:\temp7\numpy-1.3.0rc2 (where setup.py and README.txt is). I then opened a command line window and:

    d:
    cd D:\temp7\numpy-1.3.0rc2
    setup.py install
    

    This ran for a long time and also included use of cl.exe (part of Visual Studio). Here is a nearly 5000 lines long transcript (230 KB).

    This seemed to work. I can now do this in Python:

    import numpy as np
    np.random.random(10)
    

    with this result:

    array([ 0.35667511,  0.56099423,  0.38423629,  0.09733172,  0.81560421,
            0.18813222,  0.10566666,  0.84968066,  0.79472597,  0.30997724])
    

    Step 3

    Downloaded the SciPy superpack installer, scipy-0.7.1rc3- win32-superpack-python2.6.exe (direct download URL, 45597175 bytes). Running this installer resulted in the message listed in the beginning

    Step 4

    Tried to install SciPy in another way. Downloaded the zip package scipy-0.7.1rc3.zip (direct download URL, 5506562 bytes), extracted the zip file in a normal way to a temporary directory, D:\temp7\scipy-0.7.1 (where setup.py and README.txt is). I then opened a command line window and:

    d:
    cd D:\temp7\scipy-0.7.1
    setup.py install
    

    This did not achieve much - here is a transcript (about 95 lines).

    And it fails:

    >>> import scipy as sp2
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: No module named scipy
    

    Platform: Python 2.6.2 installed in directory D:\Python262, Windows XP 64 bit SP2, 8 GB RAM, Visual Studio 2008 Professional Edition installed.

    The startup screen of the installed Python is:

    Python 2.6.2 (r262:71605, Apr 14 2009, 22:46:50) [MSC v.1500 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    

    Value of PATH, result from SET in a command line window:

    Path=D:\Perl64\site\bin;D:\Perl64\bin;C:\Program Files (x86)\PC Connectivity Solution\;D:\Perl\site\bin;D:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;d:\Program Files (x86)\WinSCP\;D:\MassLynx\;D:\Program Files (x86)\Analyst\bin;d:\Python262;d:\Python262\Scripts;D:\Program Files (x86)\TortoiseSVN\bin;D:\Program Files\TortoiseSVN\bin;C:\WINDOWS\system32\WindowsPowerShell\v1.0;D:\Program Files (x86)\IDM Computer Solutions\UltraEdit\
    
  • Peter Mortensen
    Peter Mortensen over 14 years
    When I run Fredrik Lundh's script I get: "*** Unable to register! *** You probably have another Python installation!". I have updated the question with registry entries on my system. (Some of the variables are: pythonpath: 'd:\\Python262;d:\\Python262\\Lib\\;d:\\Python262\\DLLs\\', regpath: 'SOFTWARE\\Python\\Pythoncore\\2.6\\').
  • Cat Plus Plus
    Cat Plus Plus over 14 years
    If `HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.6` exists, then try to remove it and run it again. Also - do you run it with enough privileges?
  • Peter Mortensen
    Peter Mortensen over 14 years
    I tried it and got: "--- Python 2.6 is now registered!". However with the same result when running scipy-0.7.1rc3-win32-superpack-python2.6.exe. Is it expected to work on a 64 bit version of Python? (And yes, I have far too many privileges :-) (administrator). I know I shouldn't for security reasons.)
  • Peter Mortensen
    Peter Mortensen over 14 years
    Thanks! It works great and is by far the easiest way to get it working (although it is a 32 bit version and thus not a 64 bit version of SciPy). And it doesn't mess with the existing 64 bit version installation of Python.
  • stoic_monk
    stoic_monk about 14 years
    Enthought provides 64 bits build of EPD, which is free to use for academic usage (they supported the win64 port), and uses the MKL for speed. There is also another unofficial set of binaries, linked below
  • robince
    robince about 14 years
    Is 64 bit available for academic use? It would be great - from the website it looks like only 32bit is freely available.
  • Sridhar Ratnakumar
    Sridhar Ratnakumar about 13 years
    NumPy (at least v1.5.1) doesn't give this warning anymore.
  • Gaffi
    Gaffi almost 11 years
    For Python 3, a roughly equivalent version is available here