question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'RuntimeError: implement_array_function method already has a docstring' after matplotlib installation

See original GitHub issue

I’m using numpy==1.18.1 within a conda environment. Everything worked fine until I installed matplotlib==3.1.3 yesterday. After matplotlib has been installed (successfully), and I try to import either matplotlib or numpy using

import numpy

or

import matplotlib

I get the following error:

Error message:

`Traceback (most recent call last): File “C:\Users\user\AppData\Roaming\Python\Python36\site- packages\IPython\core\interactiveshell.py”, line 2963, in run_code exec(code_obj, self.user_global_ns, self.user_ns)

File “<ipython-input-2-0484cd13f94d>”, line 1, in <module> import matplotlib File “C:\Program Files\JetBrains\PyCharm 2019.2.3\helpers\pydev_pydev_bundle\pydev_import_hook.py”, line 21, in do_import module = self.system_import(name, *args, **kwargs) File "C:\Users\user\Anaconda3\envs\ma-automl-ppm\lib\site-packages\matplotlib_init.py", line 138, in <module> from . import cbook, rcsetup File “C:\Program Files\JetBrains\PyCharm 2019.2.3\helpers\pydev_pydev_bundle\pydev_import_hook.py”, line 21, in do_import module = self.system_import(name, *args, **kwargs) File "C:\Users\user\Anaconda3\envs\ma-automl-ppm\lib\site- packages\matplotlib\cbook_init.py", line 31, in <module> import numpy as np File “C:\Program Files\JetBrains\PyCharm 2019.2.3\helpers\pydev_pydev_bundle\pydev_import_hook.py”, line 21, in do_import module = self.system_import(name, *args, **kwargs) File "C:\Users\user\Anaconda3\envs\ma-automl-ppm\lib\site-packages\numpy_init.py", line 142, in <module> from . import core File “C:\Program Files\JetBrains\PyCharm 2019.2.3\helpers\pydev_pydev_bundle\pydev_import_hook.py”, line 21, in do_import module = self.system_import(name, *args, **kwargs) File "C:\Users\user\Anaconda3\envs\ma-automl-ppm\lib\site-packages\numpy\core_init.py", line 24, in <module> from . import multiarray File “C:\Program Files\JetBrains\PyCharm 2019.2.3\helpers\pydev_pydev_bundle\pydev_import_hook.py”, line 21, in do_import module = self._system_import(name, *args, **kwargs) File “C:\Users\user\Anaconda3\envs\ma-automl-ppm\lib\site- packages\numpy\core\multiarray.py”, line 14, in <module> from . import overrides File “C:\Program Files\JetBrains\PyCharm 2019.2.3\helpers\pydev_pydev_bundle\pydev_import_hook.py”, line 21, in do_import module = self._system_import(name, *args, **kwargs) File “C:\Users\user\Anaconda3\envs\ma-automl-ppm\lib\site-packages\numpy\core\overrides.py”, line 47, in <module> “”") RuntimeError: implement_array_function method already has a docstring`

Numpy/Python version information:

‘3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 14:00:49) [MSC v.1915 64 bit (AMD64)]’

installed packages within the virtual environment:

absl-py 0.9.0 alembic 1.3.2 astor 0.8.1 autokeras 1.0.0 backcall 0.1.0 bleach 2.1.3 cachetools 4.0.0 certifi 2019.11.28 chardet 3.0.4 ciso8601 2.1.2 Click 7.0 colorama 0.3.9 cycler 0.10.0 dash 1.7.0 dash-bootstrap-components 0.7.2 dash-core-components 1.6.0 dash-daq 0.3.1 dash-html-components 1.0.2 dash-renderer 1.2.2 dash-table 4.5.1 decorator 4.3.0 dnspython 1.16.0 entrypoints 0.2.3 eventlet 0.25.1 Flask 1.1.1 Flask-Caching 1.8.0 Flask-Compress 1.4.0 Flask-Migrate 2.5.2 Flask-SocketIO 4.2.1 Flask-SQLAlchemy 2.4.1 future 0.18.2 gast 0.2.2 google-auth 1.11.0 google-auth-oauthlib 0.4.1 google-pasta 0.1.8 graphviz 0.13.2 greenlet 0.4.15 grpcio 1.26.0 h5py 2.10.0 html5lib 1.0.1 idna 2.8 intervaltree 3.0.2 ipykernel 4.8.2 ipython 6.4.0 ipython-genutils 0.2.0 ipywidgets 7.2.1 itsdangerous 1.1.0 jedi 0.12.0 Jinja2 2.10.3 joblib 0.14.1 jsonschema 2.6.0 jupyter 1.0.0 jupyter-client 5.2.3 jupyter-console 5.2.0 jupyter-core 4.4.0 Keras 2.3.1 Keras-Applications 1.0.8 Keras-Preprocessing 1.1.0 keras-tuner 1.0.1 kiwisolver 1.0.1 lightgbm 2.3.1 lxml 4.4.2 Mako 1.1.0 Markdown 3.1.1 MarkupSafe 1.0 matplotlib 3.1.3 mistune 0.8.3 mkl-fft 1.0.15 mkl-random 1.1.0 mkl-service 2.3.0 monotonic 1.5 mpmath 1.0.0 nbconvert 5.3.1 nbformat 4.4.0 networkx 2.4 nose 1.3.7 notebook 5.5.0 numpy 1.18.1 oauthlib 3.1.0 opt-einsum 3.1.0 opyenxes 0.3.0 ortools 7.4.7247 packaging 20.1 pandas 0.25.3 pandocfilters 1.4.2 parso 0.2.1 pickleshare 0.7.4 pip 19.3.1 plotly 4.4.1 pm4py 1.2.8 prompt-toolkit 1.0.15 protobuf 3.11.2 psutil 5.6.5 PuLP 2.0 pyarrow 0.15.1 pyasn1 0.4.8 pyasn1-modules 0.2.8 pydotplus 2.0.2 Pygments 2.4.2 pyparsing 2.2.0 python-dateutil 2.7.3 python-editor 1.0.4 python-engineio 3.10.0 python-socketio 4.4.0 pytz 2019.3 pyvis 0.1.7.0 pywinpty 0.5.3 PyYAML 5.3 pyzmq 17.0.0 qtconsole 4.3.1 requests 2.22.0 requests-oauthlib 1.3.0 retrying 1.3.3 rsa 4.0 scikit-learn 0.22.1 scipy 1.4.1 Send2Trash 1.5.0 setuptools 42.0.1.post20191125 simplegeneric 0.8.1 six 1.11.0 sklearn 0.0 sortedcontainers 2.1.0 SQLAlchemy 1.3.12 sympy 1.1.1 tabulate 0.8.6 tensorboard 2.0.2 tensorflow 2.0.0 tensorflow-estimator 2.0.1 termcolor 1.1.0 terminado 0.8.1 terminaltables 3.1.0 testpath 0.3.1 tornado 5.0.2 tqdm 4.41.1 traitlets 4.3.2 urllib3 1.25.7 wcwidth 0.1.7 webencodings 0.5.1 websockets 8.1 Werkzeug 0.16.0 wheel 0.33.6 widgetsnbextension 3.2.1 wincertstore 0.2 wrapt 1.11.2

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Louagydcommented, May 18, 2020

you can simply just try matplotlib==3.0.3

0reactions
anhzhicommented, Mar 8, 2021

This issue may occure when numpy/matplotlib or their requiment packages degraded, with their dependency broken and version requiments not met.

For example: install package of six to 1.5.6, which break the requirement six>=1.10 of matplotlib 2.2.5 . Then this issue happens.

I found a solution that works in Pycharm.

  1. clean cache of numpy in pycharm which seems like C:\Users\anhzhi.PyCharm2019.3*numpy*
  2. remove pyc in Program Folder for JetBrains
  3. reinstall numpy/matplotlib and check their requiments strickly met.
  4. restart Pycharm and make sure numpy can import.

I think step 3 is key and make use, while step 1 and 2 explains why this issue not happens outside pycharm. I use “Everything” to find those matched files in step 1 and step 2.

I wish my comment can help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

implement_array_function method already has a docstring ...
I had issue in VSCode using python AREPEL. I fixed with: python3 -m pip install --user numpy -U $ python3 -m pip freeze...
Read more >
RuntimeError: implement_array_function ... - PythonAnywhere
My students repeatedly get this "RuntimeError: implement_array_function method already has a docstring" (only since this month), ...
Read more >
MEP10: Docstring consistency — Matplotlib 3.6.2 documentation
matplotlib has a great deal of inconsistency between docstrings. ... is not sufficient to get the numpydoc extensions -- it's a separate install...
Read more >
RuntimeError: implement_array_function method already has ...
无奈又重新安装了一次,根据上次的经验,我先安装了matplotlib,但是时隔多日它的版本升级到,自动安装的版本是3.1.1,引发了新的问题RuntimeError: ...
Read more >
Google Python Style Guide
One blank line between method definitions and between the docstring of a class and the first method. No blank line following a def...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found