Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Confusing error message when home config directory not writable #18011

Closed
Milestone
@trampgeek

Description

@trampgeek

Bug report

Bug summary

If matplotlib is run in an environment without a writable home directory, a very confusing error message is printed in which the configdir and the tempdir are interchanged.

Code for reproduction

  1. In Linux, create a usersomeone with no home directory.

  2. Run Python with a command like

    sudo -u someone python3

  3. In the Python shell, typeimport matplotlib

Actual outcome

Matplotlib created a temporary config/cache directory at /root/.config/matplotlib because the default path (/tmp/matplotlib-9yoi7m8l) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.

Expected outcome

Matplotlib created a temporary config/cache directory at /tmp/matplotlib-9yoi7m8l because the default path (/root/.config/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.

Matplotlib version

  • Operating system: Ubuntu 18.04
  • Matplotlib version: 3.3.0
  • Matplotlib backend (print(matplotlib.get_backend())): agg
  • Python version: 3.9.0b4
  • Jupyter version (if applicable): N/A
  • Other libraries: N/A

Matplotlib was compiled from source. The error is at line 482 in__init__.py at the root level in the source tree. The parameters are the wrong way round.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp