Skip to content Skip to sidebar Skip to footer

Unused Import Warning In Eclipse/pydev Although It Is Used

I am importing a plotting package in my file like this: import matplotlib.pyplot as plt and am using this import later on in my code successfully(!) fig = plt.figure(figsize=(16,1

Solution 1:

I feel embarrassed. The comments from Ignacio and Bakurio already pointed at the right direction. In fact, next to

import matplotlib.pyplotas plt

I am also importing

from pylab import *

These imports interfere with one another, since pylab is also importing pyplot. Remove the latter import results in no warning messages anymore in Eclipse. Next time I'll paste the full source code.

Solution 2:

I solve this problem going to Project -> Properties -> PyDev - PYTHONPATH and click on "Force restore internat info".

Solution 3:

I had the same problem. I installed matplotlib 1.3.1 (Win 32 bit; Python 2.7.6). In my lib/site-packages/ folder there were actually two different matplotlib folders, one containing the actual code and binaries, and another one called matplotlib-1.3.1-py2.7.egg-info. I simply deleted the one ending in ...egg-info and it worked. For an explanation, see this thread: http://matplotlib.1069221.n5.nabble.com/ANN-matplotlib-1-3-0rc1-td41151.html.

Post a Comment for "Unused Import Warning In Eclipse/pydev Although It Is Used"