matplotlib: RuntimeError: Could not find the matplotlib data files
See original GitHub issueVersions
$ 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:
- Created 4 years ago
- Reactions:1
- Comments:17 (11 by maintainers)
Top GitHub Comments
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.zipI 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