Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error installing numpy

Tags:

python

numpy

I'm trying to install numpy My steps are as follows: Open cmd in numpy extracted folder(where I had extracted .tar.gz file) Then python setup.py install But I'm getting an error as follows: enter image description here with many warnings like this and at the end error unable to find vcvarsall.bat (I regret to put a photo but I couldn't find any better way to copy text from cmd window) if possible suggest a compiled setup of numpy

like image 644
kartikeykant18 Avatar asked Dec 13 '13 13:12

kartikeykant18


People also ask

How do I fix Numpy error?

Python Numpy not found or no module found 'numpy' error in vscode can be fixed by install the numpy module extension in vscode. We can also use pip or conda package managers to fix this issue. In case you have installed the module still same error is appearing that means have to activate the dedicated environment.

Why Numpy is not installed?

The Python "ModuleNotFoundError: No module named 'numpy'" occurs when we forget to install the numpy module before importing it or install it in an incorrect environment. To solve the error, install the module by running the pip install numpy command.


2 Answers

Edit: Apparently this answer still gets attention occasionally. For anybody needing numpy, you almost certainly will be happier and more productive if you just go and get conda or miniconda which make installing all kinds of libraries like numpy very easy. In fact the first example on the page is conda install numpy. An additional bonus: I find that conda works better as a package manager than virtualenv.

Summary: Just use anaconda


There is a discussion on this on stackoverflow but I can't find it. It's easy once you know how to do it, but not obvious. The key is to use the premade binaries instead of compiling it yourself + easy_install. Unless you want to compile it yourself and that's a whole different answer.

Either installing to virtualenv or just to your main python, here is what I do:

  1. Download the latest numpy installer for windows and your version of python here.

  2. Open that file in 7zip or whatever you have. Extract the installer that works for your CPU. Probably SSE3.

  3. Put that file somewhere and get the full path to it including the name of the file.

  4. From your command line with/without virtualenv activated, type: easy_install "..." with the quotes and with your full path pasted in place of ...

  5. (extra step) you may need to add C:\python27\Scripts\ to your system path (using your actual python path) if you get an error that easy_install is not found.

That should do it. If you want to compile it yourself (if the message you posted lost you, then you probably don't), then you'll need to read up on getting a c compiler installed and setup in windows for python.

like image 80
KobeJohn Avatar answered Nov 03 '22 21:11

KobeJohn


You should be able to use the installers available here without any issues: https://sourceforge.net/projects/numpy/files/NumPy/1.8.0/

Make sure to pick the appropriate executable for your Python version.
If you are running Python 2.7 use the one linked here.

Note for future readers: If any updates to NumPy have been released, you might want to go here and choose the latest version available.

like image 40
erb Avatar answered Nov 03 '22 20:11

erb