shmn shmn - 3 years ago 214
Python Question

Error while importing matplotlib.pyplot with Geany IDE

im trying to import matplotlib.pyplot, here is my code:

import matplotlib.pyplot as plt

squares = [1, 4, 9, 16, 25]

I'm using the Geany IDE under Ubuntu 16.04.03, and i'm getting the
following errormessage

[1, 2, 3, 4, 5]
Traceback (most recent call last):
File "", line 1, in <module>
import matplotlib.pyplot as plt
File "/usr/local/lib/python3.5/dist-packages/matplotlib/", line 122, in <module>
from matplotlib.cbook import is_string_like, mplDeprecation, dedent, get_label
File "/usr/local/lib/python3.5/dist-packages/matplotlib/", line 32, in <module>
import numpy as np
File "/usr/local/lib/python3.5/dist-packages/numpy/", line 142, in <module>
from . import add_newdocs
File "/usr/local/lib/python3.5/dist-packages/numpy/", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/local/lib/python3.5/dist-packages/numpy/lib/", line 8, in <module>
from .type_check import *
File "/usr/local/lib/python3.5/dist-packages/numpy/lib/", line 11, in <module>
import numpy.core.numeric as _nx
File "/usr/local/lib/python3.5/dist-packages/numpy/core/", line 35, in <module>
from . import _internal # for freeze programs
File "/usr/local/lib/python3.5/dist-packages/numpy/core/", line 18, in <module>
from .numerictypes import object_
File "/usr/local/lib/python3.5/dist-packages/numpy/core/", line 962, in <module>
File "/usr/local/lib/python3.5/dist-packages/numpy/core/", line 958, in _register_types
AttributeError: module 'numbers' has no attribute 'Integral'

This error occurs only when i'm using the Geany IDE, when i'm running the
code in the terminal it works fine.

Has somebody an idea what's wrong with Geany?

Thanks in advance!

Answer Source

With Geany your working directory is different. I'm thinking it's the same as here:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download