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\
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]).
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.
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.
WinPython is an open-source distribution that has 64-bit NumPy and SciPy.
Another alternative: http://www.pythonxy.com/
Free and includes lots of stuff meant to work together smoothly.
This person says
Did you try linux.pythonxy ? ( http://linux.pythonxy.com ).
It's 64 bit ready ...
Though I'm not quite sure what that means.
Update:
This appears to be dead. I use Anaconda now, which has 32-bit or 64-bit installers.
For completeness: Enthought has a Python distribution which includes SciPy; however, it's not free. Caveat: I've never used it.
Update: This answer had been long forgotten until an upvote brought me back to it. At this time, I'll second endolith's suggestion of Anaconda, which is free.
Try to install Python 2.6.3 over your 2.6.2 (this should also add correct Registry entry), or to register your existing installation using this script. Installer should work after that.
Building SciPy requires a Fortran compiler and libraries - BLAS and LAPACK.
It is terrible to install such Python data science packages independently on Windows. Try Anaconda (one installer, 400 more Python packages, py2 & py3 support). Anaconda really helps me a lot!
I have a 32-bit Python 3.5 on a 64-bit Windows 8.1 machine. I just tried almost every way I can find on Stack Overflow and no one works!
Then on here I found it. It says:
SciPy is software for mathematics, science, and engineering.
Requires numpy+mkl.
Install numpy+mkl before installing scipy.
mkl matters!! But nobody said anything about that before!
Then I installed mkl:
C:\Users\****\Desktop\a> pip install mkl_service-1.1.2-cp35-cp35m-win32.whl
Processing c:\users\****\desktop\a\mkl_service-1.1.2-cp35-cp35m-win32.whl
Installing collected packages: mkl-service
Successfully installed mkl-service-1.1.2
Then I installed SciPy:
C:\Users\****\Desktop\a>pip install scipy-0.18.1-cp35-cp35m-win32.whl
Processing c:\users\****\desktop\a\scipy-0.18.1-cp35-cp35m-win32.whl
Installing collected packages: scipy
Successfully installed scipy-0.18.1
It worked~ yeah :)
A tip: You can just google "whl_file_name.whl" to know where to download it~ :)
Update:
After all these steps you will find that you still can not use SciPy in Python 3. If you print "import scipy" you will find there are error messages, but don't worry, there is only one more thing to do. Here
——just comment out that line, simple and useful.
from numpy._distributor_init import NUMPY_MKL
I promise that it is the last thing to do :)
PS: Before all these steps, you better install NumPy first. That's very simple using this command:
pip install numpy
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.
Install a Python distribution, http://www.python.org/download/.
Download and install the Anaconda Python distribution.
Make the Anaconda Python distribution link to Python 3.3 if you want NumPy, SciPy or Matplotlib to work in Python 3.3, or just use it like that to have only Python 2.7 and older functionality.
The blog post Anaconda Python Distribution Python 3.3 linking provides more detail about Anaconda.
I was getting this same error on a 32-bit machine. I fixed it by registering my Python installation, using the script at:
http://effbot.org/zone/python-register.htm
It's possible that the script would also make the 64-bit superpack installers work.
You can either download a scientific Python distribution. One of the ones mentioned here: https://scipy.org/install.html
Or pip install from a whl file here if the above is not an option for you.
http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
Okay a lot has been said, but just in case nothing of the previous answers work, you can try;
https://www.scipy.org/install.html
According to them;
For most users, especially on Windows, the easiest way to install the packages of the SciPy stack is to download one of these Python
distributions, which include all the key packages:
Anacond: A
free distribution for the SciPy stack. Supports Linux, Windows and
Mac.
Enthought Canopy: The free and commercial versions
include the core SciPy stack packages. Supports Linux, Windows and
Mac.
Python(x,y) A free distribution including the SciPy
stack, based around the Spyder IDE. Windows only.
WinPython: A
free distribution including the SciPy stack. Windows only.
Pyzo: A free distribution based on Anaconda and the IEP interactive
development environment. Supports Linux, Windows and Mac.
Still for me, Anaconda did solve this problem. Do remember to check the bit (32/64 bit) version before downloading and re-adjust your compiler to the Python implementation installed with the Python distribution you are installing.
Okey, here I am going to share what I have done to install SciPy on my Windows PC without the command line.
My PC configuration is Windows 7 64-bit and Python 2.7
First I download the required packages form http://www.lfd.uci.edu/~gohlke/pythonlibs/ (which version match your configuration EX: cp27==>python2.7 & cp35==>3.5)
Second I extract the file using 7-Zip (also can be used any zipper like WinRAR)
Third I copy the scipy folder which I extracted and paste it into C:\Python27\Lib\site-packages (or put it where the exact location is in your PC like ..\..\Lib\site-packages)
NOTE: You have to install NumPy first before installing SciPy in this same way.
I found this solution after days.
Firstly, which Python version you want to install?
If you want for Python 2.7 version:
STEP 1:
scipy‑0.19.0‑cp27‑cp27m‑win32.whl
scipy‑0.19.0‑cp27‑cp27m‑win_amd64.whl
numpy‑1.11.3+mkl‑cp27‑cp27m‑win32.whl
numpy‑1.11.3+mkl‑cp27‑cp27m‑win_amd64.whl
If you want for Python 3.4 version:
scipy‑0.19.0‑cp34‑cp34m‑win32.whl
scipy‑0.19.0‑cp34‑cp34m‑win_amd64.whl
numpy‑1.11.3+mkl‑cp34‑cp34m‑win32.whl
numpy‑1.11.3+mkl‑cp34‑cp34m‑win_amd64.whl
If you want for Python 3.5 version:
scipy‑0.19.0‑cp35‑cp35m‑win32.whl
scipy‑0.19.0‑cp35‑cp35m‑win_amd64.whl
numpy‑1.11.3+mkl‑cp35‑cp35m‑win32.whl
numpy‑1.11.3+mkl‑cp35‑cp35m‑win_amd64.whl
If you want for Python 3.6 version:
scipy‑0.19.0‑cp36‑cp36m‑win32.whl
scipy‑0.19.0‑cp36‑cp36m‑win_amd64.whl
numpy‑1.11.3+mkl‑cp36‑cp36m‑win32.whl
numpy‑1.11.3+mkl‑cp36‑cp36m‑win_amd64.whl
Link: click
Once finishing installation, go to your directory.
For example, my directory:
cd C:\Users\asus\AppData\Local\Programs\Python\Python35\Scripts>
pip install [where/is/your/downloaded/scipy_whl.]
STEP 2:
NumPy + MKL
From same web site based on the Python version again:
After that use same thing again in the script folder:
cd C:\Users\asus\AppData\Local\Programs\Python\Python35\Scripts>
pip3 install [where/is/your/downloaded/numpy_whl.]
And test it in the Python folder.
Python35>python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy
Related
I'm simply unable to install NumPy on Windows. I keep getting this error -
PS C:\python27> pip install http://sourceforge.net/projects/numpy/file/NumPy/
Collecting http://sourceforge.net/projects/numpy/files/NumPy/
Downloading http://sourceforge.net/projects/numpy/files/NumPy/ (58kB)
100% |################################| 61kB 15kB/s
Cannot unpack file c:\users\toshiba\appdata\local\temp\pip-qev4rz-unpack\NumPy
(downloaded from c:\users\toshiba\appdata\local\temp\pip-omripn-build, content-type: text/html; charset=utf-8); cannot detect archive format
Cannot determine archive format of c:\users\toshiba\appdata\local\temp\pip-omripn-build
I had a Python 64 bit version earlier and I was not sure if NumPy version was compatible with 64-bit Python. So I uninstalled it and installed a 32-bit Python version. But still I'm getting the same error. Though my Python 32-bit version is working fine.
I tried "pip install numpy", but that gave me the following error at the end -
C:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
error: Unable to find vcvarsall.bat
----------------------------------------
Command "C:\Python27\python.exe -c "import setuptools,tokenize;__file__='c:\\users\\toshiba\\appdata\\local\\temp\\pip-build-hdhqex\\numpy\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'),__file__, 'exec'))" install --record c:\users\toshiba\appdata\local\temp\pip-x_6llm-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\toshiba\appdata\local\temp\pip-build-hdhqex\numpy
What might I be doing wrong?
Some explanations
In the first case, I didn't check but I guess that pip directly downloads the resource corresponding to the given URL: http://sourceforge.net/projects/numpy/file/NumPy/. The server returns a HTML document, while pip expects an archive one. So that can't work.
Then there are basically two ways to install Python packages:
from sources, as you tried then
from pre-compiled packages
The first case, you tried it with the command pip install numpy, but since this package contains native code, it requires development tools to be installed properly (which I always found to be a pain in the neck to do on Windows, but I did it so it's clearly feasible). The error you have error: Unable to find vcvarsall.bat means you don't have the tools installed, or the environment properly set up.
For the second case, you have different kinds of pre-compiled packages:
wheels, which you install with pip as well
installers, which you use as standard installers on Windows
For both, you need to check that the binary has been strictly compiled for your Python architecture (32 or 64 bits) and version.
An easy solution
You can find there several wheels for numpy: http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy. To get the proper architecture, check in the name win32 for 32 bits and amd64 for 64 bits. To get the proper Python version, check cpXX: first X is major version, and second X is minor version, so for instance cp27 means CPython 2.7.
Example: pip install numpy‑1.9.2rc1+mkl‑cp27‑none‑win32.whl
The hard solution: installing and using development tools
DISCLAIMER: all the following explanations might not be quite clear. They result from several investigations at different moments, but in my configuration they led to a working solution. Some links might be useless, or redundant, but that's what I noted. All of this requires a bit of cleaning, and probably generalization too.
First, you need to understand that disutils - which is the pre-installed package which handles packages workflow at lower level than pip (and which is used by the latter) - will try to use a compiler that strictly matches the one that was used to build the Python machine you installed.
Official distributions of Python use Microsoft Visual C++ for Microsoft Windows packages. So you will need to install this compiler in this case.
How to find proper version of Visual C++
The string printed by Python with this command python -c "import sys; print(sys.version)" (or when you invoke the interactive shell) will look like this:
3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:45:13) [MSC v.1600 64 bit (AMD64)]
The last part between square brackets is the identification part of the compiler. Unfortunately, this is not quite straightforward, and you have correspondence lists there:
windows - What version of Visual Studio is Python on my computer compiled with? - Stack Overflow
visual studio - Detecting compiler versions during compile time - Stack Overflow3
Pre-defined Compiler Macros / Wiki / Compilers
WinCvt - Windows Converter toolkit
In the example I gave above, this means Microsoft Visual C++ 2010 64 bits.
How to install Visual C++
You cannot find anymore a standalone package of Visual C++ for modern versions. So you will need to install the Windows SDK itself.
Here are some reference links:
Download Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1 from Official Microsoft Download Center: for Visual C++ 15.00 (Visual Studio 2008). Corresponds to WinSDK 7.
Download Microsoft Windows SDK for Windows 7 and .NET Framework 4 from Official Microsoft Download Center: for Visual C++ 16.00 (Visual Studio 2010). Corresponds to WinSDK 7.1.
installation - where can I download the full installer for Visual C++ Express? - Super User
Visual Studio & co. downloads
Troubleshooting
You might have an error at the installation of the SDK:
DDSet_Error: Patch Hooks: Missing required property 'ProductFamily': Setup cannot continue.
DDSet_Warning: Setup failed while calling 'getDLLName'. System error: Cannot create a file when that file already exists.
They have been reported in several questions already:
Windows 7 SDK Installation Failure
Error installing Windows 7 SDK 7.1 with VS2008, VS2010 Premium on Win 7 32bit
As a solution, you can check this link: Windows SDK Fails to Install with Return Code 5100
The thing is to remove all conflicting (understand: the ones that the SDK installer tries to install itself) version of the Visual C++ redistributable.
Use development tools
Normally you should run vsvarsall.bat (located inside the VC folder of the installation path of Visual Studio - example: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat) to set up the proper environment variables so that the execution of distutils doesn't fail when trying to compile a package.
This batch script accepts a parameter, which should set the wanted architecture. However I saw that with the free versions of the SDK some additional scripts were missing when trying several of these parameters.
Just to say that if you are compiling for a 32 bits architecture, simply calling vsvarsall.bat should work. If you need to compile for 64 bits, you can directly call SetEnv.cmd, located somewhere under inside the SDK installation path - example: "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64.
On Windows, pip is great for installing packages that do not require compiling. Otherwise, seriously, save yourself the hassle of building and maintaining packages, and take advantage of the work others did for you. I recommend using either of these Python distributions:
ActivePython
Anaconda
Anaconda is a little larger to download and install, but it includes many useful third-party packages by default (such as numpy). ActivePython includes a package manager which allows you to easily install pre-compiled binaries (installing numpy is as easy as pypm install numpy).
The advantage of using these Python distributions is that you can get a working installation running in minutes, in an easily reproducible manner.
Best solution for this is to download and install VCforPython2.7 from https://www.microsoft.com/en-us/download/details.aspx?id=44266
Then try pip install numpy.
100% working
I tried to install numpy for windows 7, 64-bit and spent quite sometime. I was actually trying to setup sklearn. Researched many posts, documented what worked for me. Hope it saves your time!
https://simplemachinelearning.wordpress.com/2015/11/09/set-up-sklearn-on-windows/
I too faced the above problem while setting up python for machine learning.
I followed the below steps :-
Install python-2.7.13.msi
• set PATH=C:\Python27
• set PATH=C:\Python27\Scripts
Go to http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
Downloaded:- • numpy-1.13.1+mkl-cp27-cp27m-win32.whl
• scipy-0.18.0-cp27-cp27m-win32.whl
Installing numpy:
pip install numpy-1.13.1+mkl-cp27-cp27m-win32.whl
Installing scipy:
pip install scipy-0.18.0-cp27-cp27m-win32.whl
You can test the correctness using below cmds:-
>>> import numpy
>>> import scipy
>>> import sklearn
>>> numpy.version.version
'1.13.1'
>>> scipy.version.version
'0.19.1'
>>>
I am trying to install python and a series of packages onto a 64bit windows 7 desktop. I have installed Python 3.4, have Microsoft Visual Studio C++ installed, and have successfully installed numpy, pandas and a few others. I am getting the following error when trying to install scipy;
numpy.distutils.system_info.NotFoundError: no lapack/blas resources found
I am using pip install offline, the install command I am using is;
pip install --no-index --find-links="S:\python\scipy 0.15.0" scipy
I have read the posts on here about requiring a compiler which if I understand correctly is the VS C++ compiler. I am using the 2010 version as I am using Python 3.4. This has worked for other packages.
Do I have to use the window binary or is there a way I can get pip install to work?
Many thanks for the help
The following link should solve all problems with Windows and SciPy; just choose the appropriate download. I was able to pip install the package with no problems. Every other solution I have tried gave me big headaches.
Source: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
Command:
pip install [Local File Location]\[Your specific file such as scipy-0.16.0-cp27-none-win_amd64.whl]
This assumes you have installed the following already:
Install Visual Studio 2015/2013 with Python Tools
(Is integrated into the setup options on install of 2015)
Install Visual Studio C++ Compiler for Python
Source: http://www.microsoft.com/en-us/download/details.aspx?id=44266
File Name: VCForPython27.msi
Install Python Version of choice
Source: python.org
File Name (e.g.): python-2.7.10.amd64.msi
My python's version is 2.7.10, 64-bits Windows 7.
Download scipy-0.18.0-cp27-cp27m-win_amd64.whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
Open cmd
Make sure scipy-0.18.0-cp27-cp27m-win_amd64.whl is in cmd's current directory, then type pip install scipy-0.18.0-cp27-cp27m-win_amd64.whl.
It will be successful installed.
The solution to the absence of BLAS/LAPACK libraries for SciPy installations on Windows 7 64-bit is described here:
http://www.scipy.org/scipylib/building/windows.html
Installing Anaconda is much easier, but you still don't get Intel MKL or GPU support without paying for it (they are in the MKL Optimizations and Accelerate add-ons for Anaconda - I'm not sure if they use PLASMA and MAGMA either). With MKL optimization, numpy has outperformed IDL on large matrix computations by 10-fold. MATLAB uses the Intel MKL library internally and supports GPU computing, so one might as well use that for the price if they're a student ($50 for MATLAB + $10 for the Parallel Computing Toolbox). If you get the free trial of Intel Parallel Studio, it comes with the MKL library, as well as C++ and FORTRAN compilers that will come in handy if you want to install BLAS and LAPACK from MKL or ATLAS on Windows:
http://icl.cs.utk.edu/lapack-for-windows/lapack/
Parallel Studio also comes with the Intel MPI library, useful for cluster computing applications and their latest Xeon processsors. While the process of building BLAS and LAPACK with MKL optimization is not trivial, the benefits of doing so for Python and R are quite large, as described in this Intel webinar:
https://software.intel.com/en-us/articles/powered-by-mkl-accelerating-numpy-and-scipy-performance-with-intel-mkl-python
Anaconda and Enthought have built businesses out of making this functionality and a few other things easier to deploy. However, it is freely available to those willing to do a little work (and a little learning).
For those who use R, you can now get MKL optimized BLAS and LAPACK for free with R Open from Revolution Analytics.
EDIT: Anaconda Python now ships with MKL optimization, as well as support for a number of other Intel library optimizations through the Intel Python distribution. However, GPU support for Anaconda in the Accelerate library (formerly known as NumbaPro) is still over $10k USD! The best alternatives for that are probably PyCUDA and scikit-cuda, as copperhead (essentially a free version of Anaconda Accelerate) unfortunately ceased development five years ago. It can be found here if anybody wants to pick up where they left off.
Sorry to necro, but this is the first google search result. This is the solution that worked for me:
Download numpy+mkl wheel from
http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy.
Use the version that is the same as your python version (check using python -V). Eg. if your python is 3.5.2, download the wheel which shows cp35
Open command prompt and navigate to the folder where you downloaded the wheel. Run the command: pip install [file name of wheel]
Download the SciPy wheel from: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy (similar to the step above).
As above, pip install [file name of wheel]
This was the order I got everything working. The second point is the most important one. Scipy needs Numpy+MKL, not just vanilla Numpy.
Install python 3.5
pip install "file path" (download Numpy+MKL wheel from here http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy)
pip install scipy
You probably just have too new (unsupported) Python 3.x installed.
This page has overcomplicated solutions to the problem. Most of numpy / scipy users should not need to compile their numpy installations or need to rely on 3rd party "numpy+mkl" wheels.
Downloading a compiler is an anti-pattern, you do not want to build
numpy, only use it. [github.com/numpy]
Solution
Once you have installed supported python version, remove your non-working numpy installation with
pip uninstall numpy
and install scipy with
pip install scipy --only-binary numpy
The --only-binary numpy will force installing binary wheel (.whl) version of numpy. If it fails, you have too new (not yet supported) version of python.
If you have multiple python versions installed, you can ensure that pip is installing the python version you want by
<path_to_python_executable> -m pip install <X>
instead of pip install <X>.
Why this is happening?
Scipy relies on numpy, as can be seen from the setup.py or just by reading the pip install logs.
If you have too new (non-supported) python installation, there are no built wheel (.whl) in the pip repository, but tarballs (.tar.gz), which in this case require the user machine to compile some C++-code during installation. See also: Python packaging: wheels vs tarball (tar.gz)
Appendix
Check the https://pypi.org/project/numpy/ for list of supported Python versions. Currently (2020-11-04) the newest supported python version is Python 3.9. when using numpy 1.19.3 or above, and Python 3.8 for numpy 1.19.2. (For compatibility of older numpy versions, see numpy release notes)
If you are on Windows and see pip trying to install numpy-<x>.tag.gz, you know it probably will not work. Try older version of Python, instead. You want to see pip to installing a binary wheel for numpy for Windows (numpy-<x>.whl). You can check the wheels in pip available for numpy here.
If you are working with Windows and Visual Studio 2015
Install miniconda http://conda.pydata.org/miniconda.html
Change your python environment to python 3.4 (32bit)
click on python environment 3.4 and open cmd
Enter the following commands
"conda install numpy"
"conda install pandas"
"conda install scipy"
Simple and Fast Installation of Scipy in Windows
From http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy download the
correct Scipy package for your Python version (e.g. the correct
package for python 3.5 and Windows x64 is scipy-0.19.1-cp35-cp35m-win_amd64.whl).
Open cmd inside the directory containing the downloaded Scipy
package.
Type pip install <<your-scipy-package-name>> (e.g. pip install
scipy-0.19.1-cp35-cp35m-win_amd64.whl).
My 5 cents; You can just install the entire (pre-compiled) SciPy from
https://github.com/scipy/scipy/releases
Good Luck!
For python27
1、Install numpy + mkl(download link:http://www.lfd.uci.edu/~gohlke/pythonlibs/)
2、install scipy (the same site)
OK!
Intel now provides a Python distribution for Linux / Windows / OS X for free called "Intel distribution for Python".
Its a complete Python distribution (e.g. python.exe is included in the package) which includes some pre-installed modules compiled against Intel's MKL (Math Kernel Library) and thus optimized for faster performance.
The distribution includes the modules NumPy, SciPy, scikit-learn, pandas, matplotlib, Numba, tbb, pyDAAL, Jupyter, and others. The drawback is a bit of lateness in upgrading to more recent versions of Python. For example as of today (1 May 2017) the distribution provides CPython 3.5 while the 3.6 version is already out. But if you don't need the new features they should be perfectly fine.
I was also getting same error while installing scikit-fuzzy. I resolved error as follows:
Install Numpy, a whl file
Install Scipy, again a whl file
choose file according to python version like amd64 for python3 and other win32 file for the python27
then pip install --user skfuzzy
I hope, It will work for you
Solutions:
As specified in many answers, download NumPy and SciPy whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/ and install with
pip install <whl_location>
Building BLAS/LAPACK from source
Using Miniconda.
Refer:
ScikitLearn Installation
Easiest way to install BLAS and LAPACK for scipy?
do this, it solved for me
pip install -U scikit-learn
I got the same error trying to install scipy, having also installed Visual Studio C++, numpy, etc. My problem was that I'd just installed Python 3.9.
I removed version 3.9.0 and downgraded to version 3.8.6 and scipy installed without problems.
Using resources at http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy will solve the problem. However, you should be careful about versions compatibility. After trying for several times, finally I decided to uninstall python and then installed a fresh version of python along with numpy and then installed scipy and this resolved my problem.
install intel's distribution of python https://software.intel.com/en-us/intel-distribution-for-python
better of for distribution of python should contain them initially
I'm trying to install VTK module for python, I am however unsuccesful in doing so. I have downloaded a VTK tar-file, but I'm unable to extract it. I'm capable of extracting other tar-files, so there must be something specific with this file I suppose.
This is my error:
gzip: stdin: invalid compressed data--format violated
tar: Child returned status 1
tar: Error is not recoverable: exiting now
I hope somebody can help me with this.
The answer depends on the operating system you are using. This will be a lot easier if you can find a package or installer for your specific operating system and/or distribution.
Linux
If you are using Linux then look for the corresponding package in the distribution's package manager. For example, on Ubuntu Linux you should be able to install it using the following command:
sudo apt-get install python-vtk
Microsoft Windows
If you are using Microsoft Windows, the easiest way would be to install Python(x,y). It comes with VTK support.
Additionally, Anaconda also includes VTK package as well as support for virtual environments. It might be a good option for some folks.
Mac OS X
If you are using Mac OS X, try installing everything via MacPorts.
As #Nil mentioned in comments below, a standalone python interface to VTK is now provided by VTK developers. You may download it for Windows, Darwin, and Linux from here.
As mentioned by #Nil, VTK used to offer vtkpython binaries on their download page. However, they've dropped this since VTK-8.x.x as mentioned here:
Sorry, about that. We decided to drop the vtkpython binaries for 8. I want to focus our energies on supporting python wheel installs instead. There’s no timeline yet for a complete solution but we’ve made some good progress toward that recently here: https://github.com/jcfr/VTKPythonPackage.
Thus, the recommended way of installing vtkpython now is (see this page):
$ python -m pip install --upgrade pip
$ python -m pip install vtk
on Ubuntu, maybe this post will be helpful:
http://kazenotaiyo.blogspot.jp/2010/06/installing-vtk-in-ubuntu-and-making.html
The easiest way
The first and easiest is to just install the packages with the Aptitude Package Manager:
sudo apt-get install libvtk5-dev python-vtk
If you want the newest version
If you want the newest version VTK, you can also build it yourself:
Make sure CMake is installed:
sudo apt-get install cmake
Download the VTK source from the Downloads page.
Untar it:
tar xvzf vtk-5.6.0.tar.gz
Create an Out-Of-Source build and configure with CMake:
mkdir VTK_BUILD
cd VTK_BUILD
ccmake ../VTK
Make sure you enable python wrapping and set your install prefix to where you want the package to go. The default /usr/local works fine.
sudo make -j 8 install
(the -j 8 for make just makes the build process parallel assuming you've got the processors for it)
You now have VTK installed. Congrats! if you try to run vtkpython though, you'll get an error:
vtkpython: error while loading shared libraries: libvtksys.so.5.6: cannot open shared object file: No such file or directory
To fix this, append these lines to your .bash_profile, .bashrc, or .profile file in your home directory:
# add vtk paths
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib/vtk-5.6"
PYTHONPATH="$PYTHONPATH:/usr/local/lib/vtk-5.6"
You'll need to reset your terminal now.
That sets up your library and python paths for the vtkpython executable.
http://www.lfd.uci.edu/~gohlke/pythonlibs/#vtk Try this! Works for windows !
I have installed vtk without a problem under win7 via pip:
> pip install vtk
Collecting vtk
Downloading vtk-8.1.0-cp36-cp36m-win_amd64.whl (24.4MB)
100% |████████████████████████████████| 24.4MB 56kB/s
Installing collected packages: vtk
Successfully installed vtk-8.1.0
With Anacond python:
> python
Python 3.6.1 |Continuum Analytics, Inc.| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
MacOS only:
See How to Install Mayavi on MacOS
An abridged version of this for MacOS is the following: (but I recommend the full procedure based on above link, but note that it installs Mayavi too)
The following steps seem to work on MacOS:
brew install vtk
pip install vtk
This installs vtk#9.1. You may want to install brew install vtk#8.2 instead.
Tested on:
Python: 3.9.13, MacOS: 12.4 Monterey
PS. As mentioned before, this answer may be incomplete (you may need QT too, bu tI am not sure). For a complete one including Mayavi, see My answer here . I suggest following the steps there.
I didn't update all content s here because I am not sure which steps are required if you only need VTK (not Mayavi). For example, I don't know whether you need QT or not.
I have installed Numpy successfully. But on the site , there is lot of things that I have to do such as building Numpy, Scipy, downloading ATLAS, LAPACK etc. I am really confused and even I have checked some of the other queries also. Still not able to understand.
Can anyone please explain me what exactly should I do? I have cygwin installed on my pc.
How to buid Numpy? whats the use of building numpy?
How to install Scipy?
Whats ATLAS, LAPACK etc etc ?
Thank you so much(in advance).
I struggled with the same problem for a long time, and I eventually found an easy solution here`
You really should try Enthought Python Distribution. Just a single msi installation file, click a few Next and then you are done. They include lots of scientific packages in it, including numpy, scipy, matplotlib, etc., and also ipython environment.
Would WinPython an option for you?
Unless necessary, I'd see if that covers my needs
I did the following to get Scripy installed on my Windows virtualenv:
I downloaded the file here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy and then selected the file: numpy-1.11.1+mkl-cp27-cp27m-win32.whl
. The file is applicable to me as I'm running Python 2.7 and I have a win32 machine. You can check this information on your side by running python in your cmd prompt. Mine says:
Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] on win32
The reason why we download numpy first is because scipy relates on it. Under scipy on the same website: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy, it says:
Requires numpy+mkl.
Install numpy+mkl before installing scipy.
Download the applicable scipy file for you, mine was this one: scipy-0.18.0-cp27-cp27m-win32.whl
Now, you can dump them into the root of your virtualenv folder. Send the following commands in your virtualenv:
pip install numpy-1.11.1+mkl-cp27-cp27m-win32.whl
pip install scipy-0.18.0-cp27-cp27m-win32.whl
Scipy will then install successfully.
the easiest way is in the following steps:
Fixing scipy for python [ 2.n < python < 3.n ]
Download the necessary files from: http://www.lfd.uci.edu/~gohlke/pythonlibs/
Download the version of numpy+mkl (needed to run scipy) and then download scipy for your python type (2.n python written as 2n) or (3.n python written as 3n), n is a variable. Note you must know whether you have a 32bit or 64bit processor.
Create a directory somewhere on your computer, example [C:\DIRECTORY] to install the files numpy+mkd.whl and scipy.whl
Once both file are downloaded, find the location of the file on your computer and move it to the directory you created.
Example: first file installation is needed for scipy is in---> C:\DIRECTORY\numpy\numpy-0.0.0+mkl-cp2n-cp2nm-win_amd32.whl
Example: second file installation is in---> C:\DIRECTORY\scipy\scipy-0.0.0-cp2n-cp2nm-win_amd32.whl
Go to your command prompt and proceed the following example for a python version 2.n:
py -2.n -m pip install C:\DIRECTORY\numpy\numpy-0.0.0+mkl-cp2n-cp2nm-win_amd32.whl
should install
py -2.n -m pip install C:\DIRECTORY\scipy\scipy-0.0.0-cp2n-cp2nm-win_amd32.whl
should install
Test both modules on your python IDLE as following:
import numpy
import scipy
the modules are working if no errors are returned.
IFDAAS
I'm trying to install said library for use with Python. I tried downloading the executable installer for Windows, which runs, but says it doesn't find a Python installation. Then tried registering (http://effbot.org/zone/python-register.htm) Python, but the script says it can't register (although the keys appear in my register).
Then I tried downloading the source package: I run the setup.py build and it works, but when I run setup.py install it says the following:
running install
running build
running build_py
running build_ext
building '_imaging' extension
error: Unable to find vcvarsall.bat
What can I do?
UPDATE (May 2014): Like said by some comments and answers, PIL is currently unmantained, and the way to go now is to use Pillow (https://pypi.python.org/pypi/Pillow/, pip install pillow).
I found a working win7 binary here: Unofficial Windows Binaries for Python Extension Packages It's from Christoph Gohlke at UC Irvine. There are binaries for python 2.5, 2.6, 2.7 , 3.1 and 3.2 for both 32bit and 64 bit windows.
There are a whole lot of other compiled packages here, too.
Be sure to uninstall your old PILfirst.
If you used easy_install:
easy_install -mnX pil
And then remove the egg in python/Lib/site-packages
Be sure to remove any other failed attempts. I had moved the _image dll into Python*.*/DLLs and I had to remove it.
I've just had the same problem (with Python 2.7 and PIL for this versions, but the solution should work also for 2.6) and the way to solve it is to copy all the registry keys from:
HKEY_LOCAL_MACHINE\SOFTWARE\Python
to
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python
Worked for me
solution found at the address below so credits should go there:
http://effbot.slinkset.com/items/Adding_Python_Information_to_the_Windows_Registry
Compiling PIL on Windows x64 is apparently a bit of a pain. (Well, compiling anything on Windows is a bit of a pain in my experience. But still.) As well as PIL itself you'll need to build many dependencies. See these notes from the mailing list too.
There's an unofficial precompiled binary for x64 linked from this message, but I haven't tried it myself. Might be worth a go if you don't mind the download being from one of those slightly dodgy file-upload sites. Other than that... well, you could always give up and instead the 32-bit Python binary instead.
If you installed a win64 python, you need a win64 PIL. The official PIL download site only has win32, as far as I can tell. The win32 installer will not see your 64-bit python installation.
No amount of tinkering with permissions or redistributables will fix this. You could use the win32 python instead (the Win64 python is mutant anyhow; Microsoft decided that C 'long' should be 32 bits in their 64-bit world, so python 'ints' are only 32 bits in Win64 python).
Since sizeof(long)!=sizeof(ptr) in win64, porting C extensions can be problematic, and will not be the same as porting them to linux 64. E.g. it seems that Win64 numpy is experimental/broken whereas linux64 numpy has been fine for years. My recommendation is if you use win64, stick with win32 python. If you want 64-bit python use linux.
I think I had a similar problem in the past, with another python library. I believe that it was a windows permission issue. Try adding "Users" to your python directory, and give them full access.
Make sure you have the Visual C++ Redistributable package installed on your machine.
Just got this error msg on my 32 bit Windows - I read the FAQ here: http://pythonware.com/products/pil/faq.htm and this sort of indicates that Windows is funny. Looked again at install pg and downloaded the Windows executable for Python26 # Python Imaging Library 1.1.7 for Python 2.6 (Windows only) - and the _imaging module gets installed when you run this. Should solve problem. So you can't just do the python setup.py install routine on: Python Imaging Library 1.1.7 Source Kit (all platforms) (November 15, 2009).
I was having the same problem so I decided to download the source kit and install it according to how you posted above...
Downloaded Source Kit
Opened command prompt on that folder and typed python setup.py build
Then I typed python setup.py install
It worked perfectly!
Now, some notes: when I typed python setup.py build, I saw that Microsoft Visual Studio v9.0 C compiler was being used to build everything.
So probably it's something with your compiler not correctly configured or something...
Anyways, that worked with me so thank you!
Pillow is new version
PIL-1.1.7.win-amd64-py2.x installers are available at
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil
http://www.lfd.uci.edu/~gohlke/pythonlibs/
press contrl F
type Pillow‑2.4.0.win‑amd64‑py3.3.exe
then click and downloadd the 64 bit version
Pillow is a replacement for PIL, the Python Image Library, which provides image processing functionality and supports many file formats.
Note: use from PIL import Image instead of import Image.
PIL‑1.1.7.win‑amd64‑py2.5.exe
PIL‑1.1.7.win32‑py2.5.exe
Pillow‑2.4.0.win‑amd64‑py2.6.exe
Pillow‑2.4.0.win‑amd64‑py2.7.exe
Pillow‑2.4.0.win‑amd64‑py3.2.exe
Pillow‑2.4.0.win‑amd64‑py3.3.exe
Pillow‑2.4.0.win‑amd64‑py3.4.exe
Pillow‑2.4.0.win32‑py2.6.exe
Pillow‑2.4.0.win32‑py2.7.exe
Pillow‑2.4.0.win32‑py3.2.exe
Pillow‑2.4.0.win32‑py3.3.exe
Pillow‑2.4.0.win32‑py3.4.exe