0

i have tried several times to import matplotlib and remove reinstall all of the possible combinations
i am using conda as package management system, and pip points to conda

trying to run following programm:

import matplotlib.pyplot as plt

or just:

import matplotlib

creates following result:

Traceback (most recent call last):
  File "C:/Users/Name/IdeaProjects/zzArchiv/Robot project/RobotProject/DeepLearning/approaches/hvasstutorial/anothermain.py", line 22, in <module>
    import matplotlib.pyplot as plt
  File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\__init__.py", line 127, in <module>
    from . import cbook
  File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\cbook\__init__.py", line 2640, in <module>
    class _StringFuncParser(object):
  File "D:\ProgramData\Anaconda3\lib\site-packages\matplotlib\cbook\__init__.py", line 2652, in _StringFuncParser
    _funcs['quadratic'] = _FuncInfo(np.square,
AttributeError: module 'numpy' has no attribute 'square'

i googled a lot and searched left and right, but couldn't get any working solutions (most tell to remove and reinstall numpy/matplotlib which i did several times) please help, if you have any clues

thanks

Gotti92
  • 742
  • 1
  • 6
  • 22
  • The only clue one can give here is the one you already have: Wipe numpy and matplotlib and freshly install them. Since numpy is a dependency of matplotlib, you can limit yourself to installing matplotlib and let conda choose the right numpy version for you. – ImportanceOfBeingErnest Aug 04 '18 at 21:27
  • yeah thanks, i tried that already, it didnt work (i am thinking about having a different location for the libraries too, but didnt really find any so far – Gotti92 Aug 04 '18 at 21:29
  • Looks like a path problem to me. – zar3bski Aug 04 '18 at 21:34
  • i am bad when it comes to configuration management, but it seems like importing numpy points to "D:\ProgramData\Anaconda3\Lib\site-packages\Cython\Includes\numpy" is there a way to have it point to "D:\ProgramData\Anaconda3\Lib\site-packages\numpy" without chaning the matplotlib source files? – Gotti92 Aug 04 '18 at 21:41
  • Check the folder of the script, there might be a file named numpy.py there? – ayhan Aug 04 '18 at 21:43
  • i have now removed the Cython folder, and checked the folder of the script, it doesnt contain a numpy.py file, i still get the same output – Gotti92 Aug 04 '18 at 21:48
  • You first need to arrive at a state where you cannot import those libraries, i.e. `import numpy` would fail with `No module named numpy`. Then you can reinstall. – ImportanceOfBeingErnest Aug 04 '18 at 23:22
  • @ImportanceOfBeingErnest i did that i removed matplotlib, then numpy, then installed matplotlib again and i get the same issue – Gotti92 Aug 05 '18 at 09:25

0 Answers0