0

I have been trying to import matplotlib in Python3 when facing this problem.

>>> import matplotlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 123, in <module>
    from . import cbook
  File "/usr/lib/python3/dist-packages/matplotlib/cbook/__init__.py", line 36, in <module>
    import numpy as np
  File "/home/bob/.local/lib/python3.6/site-packages/numpy/__init__.py", line 142, in <module>
    from . import core
  File "/home/bob/.local/lib/python3.6/site-packages/numpy/core/__init__.py", line 59, in <module>
    from . import numeric
  File "/home/bob/.local/lib/python3.6/site-packages/numpy/core/numeric.py", line 3093, in <module>
    from . import fromnumeric
  File "/home/bob/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 17, in <module>
    from . import _methods
  File "/home/bob/.local/lib/python3.6/site-packages/numpy/core/_methods.py", line 158, in <module>
    _NDARRAY_ARRAY_FUNCTION = mu.ndarray.__array_function__

***AttributeError: type object 'numpy.ndarray' has no attribute '__array_function__'***
2

1 Answer 1

0

Try by using the following code

import matplotlib as plt
% matpllotlib inline
Sign up to request clarification or add additional context in comments.

2 Comments

I found out that it actually stems from the repetition of numpy !!!Thanks a lot for helping me !!!
Well no problem and good luck for your code

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.