Skip to content Skip to sidebar Skip to footer

Python Newbie: Importing Numpy Module In Eclipse

I'm trying to run a simple python program in eclipse. This is the first time that I'm importting any module. So I downloaded: numpy and pylab (I'm using a mac) restarted my eclipse

Solution 1:

If you are using PyDev, you should first have to go to Preferences, then Pydev, then Interpreter Python and then Libraries to add NumPy.

Else, verify that you have NumPy installed, from the interpreter, just call from numpy import *

Edit:

Also check you already have Matplotlib installed, the error you are getting on the console points to that being the cause, you can download Matplotlib here.

Solution 2:

I recently installed Anaconda3 and just started learning how to use Pandas and I wanted to be able to work with Pandas in Eclipse as well.

I first tried adding a reference to the site-libraries at:

C:\Anaconda3\Lib\site-packages

And it seemed to work by allowing me to import numpy and pandas. However, since I had just used conda to update everything, my Python34 interpreter seemed to fail when I tried running some code and numpy was looking for my Python35 installation. For some reason this was located at:

C:\Users\myname\AppData\Local\Programs\Python\Python35-32

However, Anacondas installed another version somewhere else. By going into:

Windows > Preferences > PyDev > Interpreters > Python Interpreter

and clicking on Quick Auto-Config it found my Anacondas version of Python35 and then I just had to figure out how to make my current project use the Python35 interpreter.

Hint: To do this, you need to go into the Project properties by opening the project and choosing File > Properties or right-click the project to choose Properties.

Solution 3:

Simply removed the old numpy and installed version 6. located here

Another way to circumvent this problem is to use pip install numpy check how to install pip

Post a Comment for "Python Newbie: Importing Numpy Module In Eclipse"