2

This is stemming from a previous question I asked last night here. In the matplotlib API there is the following call to return the path to matplotlib data:

matplotlib.get_data_path()

Where does this path come from? I printed the Python environment variables using:

print(os.environ)

and I do not find a similar path. There is nothing that I can see within the matplotlib API to change this path, like a matplotlib.set_data_path() method. My problem is that the Navigation Toolbar icons (using a GTK backend) from a frozen script (using PyInstaller) are not showing up on some computers, and the culprit seems to be this path not being correct. Any assistance would be appreciated.

Leigh K
  • 561
  • 6
  • 20
  • And is there no variable for storing the data path, something like `matplotlib.data_path`? – Sylvester Kruin Nov 04 '21 at 17:47
  • For anyone looking into this problem, [here](https://github.com/matplotlib/matplotlib/blob/0115b4354ae9c9b0c7e3b656565ab0c3aaf32185/lib/matplotlib/__init__.py#L524) is the function definition for `get_data_path`. My best guess is that the absolute path gets logged and then frozen. Maybe this could be resolved through monkey patching to log the relative path? Maybe removing the decorator would do the trick, too, as then the absolute path is never frozen. – Paul Brodersen Nov 05 '21 at 15:20

0 Answers0