0

I'm working with python 2.7 (32-bit) on Windows Vista. I downloaded some libraries including numpy, scipy, and pygame. When I try to import these modules the output says

Traceback (most recent call last):
 File "<pyshell#0>", line 1, in <module>
 import numpy
ImportError: No module named numpy

I can find these modules in my python folders but for some reason it doesn't want to recognize it or some thing. (I made sure the file were compatible before downloading.)

Holger Just
56.6k15 gold badges124 silver badges137 bronze badges
asked Sep 11, 2011 at 21:02
3
  • 2
    It looks like you didn't install them correctly. After downloading and extracting each package run python setup.py install in each of the packages Commented Sep 11, 2011 at 21:07
  • Install numpy from here: sourceforge.net/projects/numpy/files/NumPy/1.6.1/… Commented Sep 11, 2011 at 21:55
  • numpy, scipy and pygame all have windows installers. Two clicks. This is what I would recommend IMHO Commented Dec 6, 2011 at 12:39

3 Answers 3

4

Each package should contain a setup.py file. Run this with the command python setup.py install

For more information:

http://www.scipy.org/Installing_SciPy/Windows http://pygame.org/install.html

answered Sep 11, 2011 at 21:15
Sign up to request clarification or add additional context in comments.

1 Comment

Everytime I run the command "python setup.py install" in the python shell it says SyntaxError: invalid syntax
1

"Everytime I run the command "python setup.py install" in the python shell it says SyntaxError: invalid syntax "

Please create a folder where you unzip the "numpy.zip" file, say the folder name is "c:\numpy"

Open a MS-DOS terminal (as described here : http://en.wikipedia.org/wiki/Command-line_interface), and type :

cd c:\numpy
python setup.py config
python setup.py install

This will set up the needed files in the correct folders for your python. Enjoy !

answered Sep 12, 2011 at 14:29

5 Comments

So I made a new folder called "c:\numpy" (I make it straight onto the computer like that right?) then I tried the sugested code in every terminal I could think of including command prompt, the python IDLE, the python interactive shell, and pypm, and nothing worked. Sorry but I am rather new at this.
The folder you made looks perfect : the installation folder must be different from the running folder (for every python package). The terminal you must use is the "old ms-dos" terminal like described here : en.wikipedia.org/wiki/Command-line_interface -- I do not use windows anymore since years, so I do not know exactly how you can reach it. If you do not succeed, I can ask my daughter this evening, let me know.
I looked on an XP machine; it's under start > accessories > command prompt. Good luck now !
When ever I try it in command prompt it said this 'python: can't open file 'setup.py': [Errno 2] No such file or directory' when you said "Please create a folder where you unzip the "numpy.zip" file, say the folder name is "c:\numpy"" did that mean I need to move the numpy files into c:\numpy and how do I unzip them into it, it doesn't show any sign of being ziped in the original file? Sorry if these are stupid questions and thank you for all the help!
These are really other questions. Please serch hor to unzip or copy files, in this site or google it. And also consider to vote up for our answers and to accept one. This will not cost you and will help.
0

To properly install this module:

  1. In the Windows search bar (START MENU) type Command Prompt
  2. Right-click on the Command Prompt icon (DO NOT go to cmd)
  3. Click Run as Administrator
  4. in the COMMAND PROMPT (DO NOT open cmd) type:

pip install numpy

This will install that module.

What it will look like

NOTE: If you are NOT in admin mode, you will get a message saying a fatal error has been raised.

answered Sep 26, 2017 at 15:32

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.