Python newbie: import numpy module in eclipse

I am trying to run a simple python program in eclipse. This is the first time that I import any module.

So I downloaded: numpy and pylab (I use mac) restarted my eclipse and the red line below

import numpy import pylab 

disappeared, so I realized that the link to this module is fine.

The problem is that I still see the red line under the code and wonder why? I must emphasize that I believe that numpy is already โ€œpre-installedโ€. I just updated the version (using 1.5.1-py2.7).

Can anyone tell me what to do to run this code?

enter image description here

my interpreter setup on eclipse:

enter image description here

+4
source share
3 answers

Just uninstall the old numpy and installed version 6. here

Another way around this problem is to use pip install numpy to check how to install the protocol

+1
source

If you use PyDev, you first need to go to settings, then to Pydev, then the Python interpreter, and then to the libraries to add NumPy.

Else, make sure you have NumPy installed, from the interpreter just call from numpy import *

Edit:

Also check that you already have Matplotlib installed, the error you get on console points is the reason you can download Matplotlib here .

+4
source

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

First I tried to add a link to the site libraries at:

 C:\Anaconda3\Lib\site-packages 

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

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

However, Anacondas installed a different version somewhere else. Going to:

 Windows > Preferences > PyDev > Interpreters > Python Interpreter 

and by clicking Quick Auto-Config , he found my version of Anacondas Python35, and then I just needed to figure out how to make my current project using the Python35 interpreter.

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

+2
source

Source: https://habr.com/ru/post/1400864/


All Articles