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.

matplotlib: RuntimeError: Could not find the matplotlib data files

See original GitHub issue

Versions

$ python3 -m nuitka --version

0.6.3.1 Python: 3.6.8 (default, Apr 25 2019, 21:02:35) Executable: /usr/bin/python3 OS: Linux Arch: x86_64

>>> sys.version

‘3.6.8 (default, Apr 25 2019, 21:02:35) \n[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]’

$ pip3 show matplotlib

Name: matplotlib Version: 3.0.3 Summary: Python plotting package Home-page: http://matplotlib.org Author: John D. Hunter, Michael Droettboom Author-email: matplotlib-users@python.org License: PSF Location: /usr/local/lib64/python3.6/site-packages Requires: cycler, numpy, kiwisolver, python-dateutil, pyparsing Required-by:

Installation

$ yum install python36 $ pip3 install Nuitka $ pip3 install matplotlib

Issue

I had a much bigger script but boiled it down to this gem of a one-liner:

import matplotlib.pyplot as plt

It compiled, although I did get the following warnings just prior to scons:

$ python3 -m nuitka --standalone --show-progress --show-scons test_matplotlib.py

… Nuitka:INFO:Optimizing module ‘_codecs_hk’, 2 more modules to go after that. Nuitka:INFO:Optimizing module ‘_codecs_cn’, 1 more modules to go after that. Nuitka:INFO:Optimizing module ‘_bz2’, 0 more modules to go after that. Nuitka:WARNING:Unresolved ‘__import__’ call at ‘/usr/local/lib64/python3.6/site-packages/numpy/core/function_base.py:453’ may require use of ‘–include-plugin-directory’ or ‘–include-plugin-files’. Nuitka:WARNING:Unresolved ‘__import__’ call at ‘/usr/local/lib64/python3.6/site-packages/numpy/lib/utils.py:366’ may require use of ‘–include-plugin-directory’ or ‘–include-plugin-files’. Nuitka:WARNING:Unresolved ‘__import__’ call at ‘/usr/local/lib64/python3.6/site-packages/numpy/lib/utils.py:865’ may require use of ‘–include-plugin-directory’ or ‘–include-plugin-files’. Nuitka:WARNING:Unresolved ‘__import__’ call at ‘/usr/local/lib64/python3.6/site-packages/numpy/lib/utils.py:923’ may require use of ‘–include-plugin-directory’ or ‘–include-plugin-files’. Nuitka:INFO:Total memory usage before running scons: 775.68 MB (813355008 bytes): …

Upon trying to run I get:

Traceback (most recent call last): File “/test/test_matplotlib.dist/test_matplotlib.py”, line 1, in <module> File “<frozen importlib._bootstrap>”, line 971, in _find_and_load File “<frozen importlib._bootstrap>”, line 955, in _find_and_load_unlocked File “<frozen importlib._bootstrap>”, line 656, in _load_unlocked File “<frozen importlib._bootstrap>”, line 626, in _load_backward_compatible File “/test/test_matplotlib.dist/matplotlib/__init__.py”, line 1099, in <module matplotlib> File “/test/test_matplotlib.dist/matplotlib/__init__.py”, line 940, in rc_params File “/test/test_matplotlib.dist/matplotlib/__init__.py”, line 746, in matplotlib_fname File “/test/test_matplotlib.dist/matplotlib/__init__.py”, line 744, in gen_candidates File “/test/test_matplotlib.dist/matplotlib/__init__.py”, line 413, in wrapper File “/test/test_matplotlib.dist/matplotlib/__init__.py”, line 690, in get_data_path File “/test/test_matplotlib.dist/matplotlib/__init__.py”, line 684, in _get_data_path RuntimeError: Could not find the matplotlib data files

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
JorjMcKiecommented, Jun 13, 2019

I think mpl-data and all it includes needs to be added to nuitka similarly to this, because manual copying works: #215

The correct (!) version of numpy does that. Either you use hinted compiles or you specify --enable-plugin=numpy=matplotlib and it should work. I sadly realized that release 0.0.4 and also the current development version did not pick up the most current plugins. If you want to try them out, copy the directory from this ZIP: hinting.zip

0reactions
hclivesscommented, Jun 13, 2019

I think mpl-data and all it includes needs to be added to nuitka similarly to this, because manual copying works: https://github.com/Nuitka/Nuitka/issues/215

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not find the matplotlib data files - Stack Overflow
When i run the script in python idle i dont get this error. I've tried: import matplotlib setup( data_files=matplotlib.get_py2exe_datafiles(), ).
Read more >
py2exe message" RuntimeError: Could not find the matplotlib ...
OK, I'm on Win7. From the py2exe tutorial, I've found that hello.exe works as expected by the tutorial. That file is in the...
Read more >
Pyinstaller: Could not find the matplotlib data files - Reddit
When you have trouble with libraries, it's always worth checking which version of Python they require, i.e. go to the relevant page on...
Read more >
[Example code]-Could not find the matplotlib data files
I am new to python and I am trying to create an .exe from py script with pyinstaller but I get this error...
Read more >
RuntimeError: Could not find the matplotlib data files - Google Groups
RuntimeError : Could not find the matplotlib data files. 122 views ... I use GUI2Exe to compile my python code but I found...
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