I doubt you would see much of a performance jump, just by switching to the 64-bit. The bigger problem I see is the fact that Excel 64-bit cannot load 32-bit binaries, which means it will likely break most, if not all of your add-ins. Some add-ins may develop 64-bit versions, but in my experience, most do not.
Compared to OSX and Linux, building NumPy and SciPy on Windows is more difficult,largely due to the lack of compatible, open-source libraries like LAPACK orATLAS that are necessary to build both libraries and have them performrelatively well. It is not possible to just call a one-liner on the commandprompt as you would on other platforms via
sudoapt-getinstall
machinery.This document describes one option to build OpenBLAS and SciPy from source thatwas validated for scipy 1.0.0. However, in light of all the work currently beingdone, do not expect these instructions to be accurate in the long-run and besure to check up on any of the open source projects mentioned for the most up-to-dateinformation. For more information on all of these projects, the Mingwpy websiteis an excellent source of in-depth information than this document will provide.
This section provides the step-by-step process to build the released scipy. If you wantto build completely from source, you should estimate at least three hours to build alllibraries and compile SciPy. Feel free to stop and inspect any step at any time, butfor this section, we’ll just mention the steps without providing an in-depth explanationfor the reasons behind them. If you have further questions about what we’re doing, morein-depth documentation is provided in the sections below. Also, please make sure to readthis section before proceeding, as the presence or absence of error messages in generalis not a good indication of whether you’ve completed a step correctly. Each step createsparticular files, and what ultimately matters is whether you have built the required filesrather than whether error messages appeared in your terminal.
First, we need to install the software required to build OpenBLAS, which is the BLASlibrary that we’re going to use. Because the software to build OpenBLAS is different thanthat required to build SciPy and because OpenBLAS takes a long time to build, we’re goingto start building OpenBLAS first and then explain what to do next while the OpenBLAS buildis running. Alternatively, if you’d rather download a pre-built OpenBLAS, download theone of thepre-built zip filesand skip to the Installing OpenBLAS section below.
Otherwise, install MSYS2 using these instructions including the pacman updateinstructions. Occasionally during the updates the terminal might ask you to close theterminal but then might refuse to be closed and hang. If this happens you can kill it viaTask Manager and continue with the instructions. Make sure to install the correctarchitecture for the SciPy that you want to build (eg. 32 or 64 bit). Now, you have threeoptions for opening a terminal which are MSYS2, MINGW (32 or 64 bit). After updating allthe packages, now we are ready to install some more package bundles that we will need.Open a MSYS2 terminal and type the following depending on the architecture of yourchoice; run the following for a 32-bit build
and for 64-bit
It will prompt to whether install everything in these packages and you can simply acceptall via hitting enter key at each step.
We should be aware of the fact that these tools also install Python2, very similar toa virtual environment, which is only usable within an MSYS2 terminal and we are notgoing to use it at any point. After updating, now we are going to use the buildtoolchain that we have installed in the previous step. Depending on 32/64bit choice,we will switch to another shell that MSYS2 created. In your start menu you shouldsee three MSYS2 terminal shortcuts. Select the one with either 64 or 32bit indicator.The reason why we do this is that the toolchain and compilers are available to theseshells and not to the standard MSYS2 terminal.
If you already have a GitHub repository folder where you keep your own repos, it is betterto use that location to keep things nice and tidy since we are going to clone yet anotherrepository to obtain the source code, hence
You don’t necessarily need to build in that particular location, but it should be somewhereconvenient. To make sure that we’re ready to build, type the following in the terminal:
These commands should give errors as we have not provided any arguments to them.However an error also implies that they are accessible on the path. Now clonethe repository required to build OpenBLAS:
If any of these commands fail, you’re not ready to build. Go back and make sure that MSYS2is installed correctly and has the required packages enabled. Now, let’s set someenvironment variables. In the MSYS2 terminal, type the following.
Please check these variables’ purpose for a moment. More specifically, make sure thatyou have read/write access to the path that
OPENBLAS_ROOT
points to. The output of theOpenBLAS build will be collected in this folder. Make sure that the OPENBLAS_COMMIT
points to the correct OpenBLAS commit that you want to build in the cloned repo. In thefuture, build_openblas
repository might get updated and you might want to get thoseupdates by changing the commit. Make sure that the architecture is correctly set to either32 or 64 bit. And after you’ve made sure of that, start the OpenBLAS build with:Building OpenBLAS is challenging. The build may fail with an error after a fewhours but may also fail silently and produce an incorrect binary. Please, if youhave any issues, report them so that we can save the next person’s time.
While you’re waiting on OpenBLAS to finish building, go ahead and install build toolsfrom Microsoft, since these take a while to install and you’ll need them later.
After the
build_openblas.sh
script has completed (probably with an error), thereshould be an openblas.a
file somewhere on your system. If OPENBLAS_ROOT
wasset to C:opt
, then you might see a line like this in the MSYS2 terminal:If you see that line, then you might have OpenBLAS correctly built, even if other failuresmight have occurred. Look in that folder for
openblas.a
. If you find a file calledsomething like libopenblas_5f998ef_gcc7_2_0.a
, just rename it to openblas.a
and continue. If the file isn’t there, then poke around and try to find the file elsewherein OPENBLAS_ROOT
. If you don’t have that file, you’ll probably need to find out whathappened and then build OpenBLAS again. But if you have that file, we’ll assume that you’vecompleted this step correctly. Proceeding on that assumption, let’s build SciPy.Before continuing, make sure that you don’t have other copies of either
openblas.lib
orlibopenblas.lib
on your computer elsewhere.Multiple copies could result in later build errors that will be difficult to debug.You may verifiy that the openblas library was correctly picked up by looking forthe following in your build log:Once you have built OpenBLAS, it’s time to build SciPy. Before continuing make sure toinstall the following software for building on the latest Python version. For buildingon other Python versions, see the WindowsCompilers page.
- Install Microsoft Visual Studio 2015 or 2017 Community Edition (use the build toolsfrom Microsoft)
- Finally, install Python from https://python.org/ (make sure to check the box to installpip)
After you’ve installed the required software, open an MSYS2 terminal, change to a goodlocation to build, and clone SciPy.
Now we need to copy the
openblas.a
file that we’ve built earlier to the correctlocation. If your Python is installed somewhere like the following:Then you’ll need to put the
openblas.a
file somewhere like the following:Adjust the location accordingly based on where
python.exe
is located. Now for asanity check. Type the following and press enter.If you see an error with the above command,
gfortran
is not correctly installed.Go back to the “Building OpenBLAS” section and make sure that you have installed the correcttools.Now install the dependencies that we need to build and test SciPy. It’s important that youspecify the full path to the native Python interpreter so that the built-in MSYS2 Python willnot be used. Attempting to build with the MSYS2 Python will not work correctly.
Please note that this is a simpler procedure than what is used for the official binaries.Your binaries will only work with the latest NumPy (v1.14.0dev and higher). Forbuilding against older NumPy versions, see Building Against an Older NumPy Version.Make sure that you are in the same directory where
setup.py
is (you should be if youhave not changed directories):Assuming that you have set up everything correctly, you should be ready to build. Runthe following commands:
Congratulatations, you’ve built SciPy!
If you want to build SciPy to work with an older numpy version, then you will needto replace the NumPy “distutils” folder with the folder from the latest numpy.The following powershell snippet can upgrade NumPy distutils while retaining an olderNumPy ABI.
As discussed in the overview, this document is not meant to provide extremely detailed explanations on how to buildNumPy and SciPy on Windows. This is largely because currently, there is no single superior way to do soand because the process for building these libraries on Windows is under development. It is likely that anyinformation will go out of date relatively soon. If you wish to receive more assistance, please reach out to the NumPyand SciPy mailing lists, which can be found here. There are manydevelopers out there, working on this issue right now, and they would certainly be happy to help you out! Google is alsoa good resource, as there are many people out there who use NumPy and SciPy on Windows, so it would not be surprising ifyour question or problem has already been addressed.
I've been trying to install numpy with yum (instructions here), and the tar.gz file (instructions here), but with no positive result.
![Numpy install Numpy install](/uploads/1/2/5/8/125859976/616210045.png)
yum gives me this output:
For the tar.gz, I do the following: I unpack it in the
/usr/local/lib/python2.7/site-packages/
folder. I go in that folder and type Afterwards running
sudo python setup.py install --prefix=/usr/local
or sudo python setup.py install
install gives me something similar to the above. What am I doing wrong? Is there another way to do this?
DanaDana
migrated from stackoverflow.comAug 23 '12 at 22:08
This question came from our site for professional and enthusiast programmers.
1 Answer
Make sure you have following RPM installed. Version could be change according your OS version
SatishSatish