I just got a new computer, and I was installing some Python libraries. When I tried to install numpy, I got a message on the console saying numpy was already downloaded. I went into the library folder, and not only was numpy there, but scipy, matplotlib, and a bunch of other libraries as well. How is this possible, considering this computer is brand new? I had installed Python the previous evening, so does installing Python automatically install these libraries as well?
It depends on which Python package you install.
On any desktop oriented Linux distribution, installing the Python package will only install Python. And in practice, it is generally already installed.
On Windows (and perhaps OS X), you need to pick a Python bundle somewhere. Perhaps did you choose Anaconda, which AFAIK installs a lot of common Python libraries (as opposed to its light version Miniconda).
Python does not ship with these libraries unless you are using a pre-packaged distribution such as Anaconda.
If you copied your data from your previous computer to this one, you may have copied the python installation (and thereby the libraries you had installed before) in your appdata folder.
Another possibility is that you have install Anaconda, which is targeted especially at scientific things, and comes with numpy, scipy and some other things preinstalled.
Although this is not the place for these types of questions, yes, there is no need to install libraries, as most of the times when you download Python in a distribution, such as Anaconda, they are also included.
I have a question which is very similar to Import Error: No module named numpy but the answer to that question I do not believe would be appropriate for me, so I'm asking again.
This is my most recent effort after about six hours of trying to get modules to work in python (numpy is a dependency of something else), so I'm finally turning to SO. Part of efforts in the last six hours included installing the enthought distribution, as its large volume of libraries was highly advised for windows users. I've even thrown the location of numpy folder onto the path of environment variables just to exclude it as a possibility.
Windows, 64bit, Python 2.7
Since you are on windows, I highly recommend that you install ANACONDA. This way the environment variables are set automatically and you don't need to worry about anything else. There are many useful packages (e.g. numpy, sympy, scipy) which are bundled with anaconda.
Moreover, based on personal experience I can tell you that using pip on windows and compiling from source (you need visual studio) is a pain in the neck sometimes. That's why ANACONDA has been conceived.
Hope this helps.
For python versions > 3.4 ,do this
pip install numpy beacuse pip is python dependency which installs packages just like npm in js i.e. node.js
I'm trying to start with OpenCV with python. I have experience c# and I have knowledge of c++. However, I feel more comfortable with python instead of c++. I installed OpenCV then python 3.4 in visual studio 2015. At the beginning I've received an error numpy, "Module couldn't be found", thankfully, I resolved it. The I got another error cv2 "Module couldn't be found" I asked an question yesterday, but I think the question has been left away. Anyways, I'm not complaining, but I still need some help please to stat with OpenCV in python.
Installing python 3.4 Successful
Installing numpy Successful
installing matpilotlib Failed
installing cv2 Failed
can anybody help me please thanks a lot.
It's very common to install Python packages through pip today (recursive acronym for pip installs packages). However, this is not that trivial under Windows.
How to install matplotlib:
Try to open a commandline and type in pip install matplotlib. If this does not work, you'll need to do some more work to get pip running. I gave a detailed answere here: Not sure how to fix this Cmd command error?.
How to install OpenCV:
The Python OpenCV DLL must be made for your version of Python and your system architecture (or, to be more specific, the architecture your Python was compiled for).
Download OpenCV for your Python version (2/3)
Try replacing the x64 version with the x86 version
There are a lot of different binaries here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv. Try to get the one exactly matching your Python version and System architecture and install it via pip (cp35 means CPython version 3.5 ect.).
If you have the OpenCV .whl file matching your system configuration, do pip install file.whl.
Hope this helps!
You can install matplotlib using pip (which is already installed on your machine - mentioned in your previous quesiton):
pip install matplotlib
more info:
http://matplotlib.org/faq/installing_faq.html
You may be better off using an package such as pythonxy as a start, e.g. from https://python-xy.github.io/ , instead of installing each single package manually.
I'm doing what this page says:
http://www.scipy.org/scipylib/building/windows.html
but, I can't find LAPACK\INSTALL\make.inc.LINUX, I also don't understand how to "Copy the file LAPACK\INSTALL\make.inc.LINUX to LAPACK\make.inc"
can't find makeinc
thank you. I also want to know, what is the easiest way to install scipy on win7, python 2.7.6?
The easiest way to install scipy (and other packages with several dependencies) on windows is through the [Unofficial Windows Binaries for Python Extension Packages] provided by Christoph Gohlk.
If you install is Numpy+MKL from this repo, it is already linked to the Intel Math Kernel Library, which includes LAPACK. After that, it will be easier to install scipy, either through one of these packages or pip.
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