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

Appearance settings

KeyError: 'getpwuid(): uid not found: 5001' #5940

Copy link
Copy link
Closed
@cancan101

Description

@cancan101
Issue body actions

I am trying to use matplotlib inside a Docker container running as non root. When I do I get the following:

$ docker run -u 5001  -it  4catalyzer/ipython python -c 'import matplotlib'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/__init__.py", line 1131, in <module>
    rcParams = rc_params()
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/__init__.py", line 965, in rc_params
    fname = matplotlib_fname()
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/__init__.py", line 794, in matplotlib_fname
    configdir = _get_configdir()
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/__init__.py", line 649, in _get_configdir
    return _get_config_or_cache_dir(_get_xdg_config_dir())
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/__init__.py", line 626, in _get_config_or_cache_dir
    return _create_tmp_config_dir()
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/__init__.py", line 555, in _create_tmp_config_dir
    tempdir = os.path.join(tempdir, 'matplotlib-%s' % getpass.getuser())
  File "/usr/lib/python2.7/getpass.py", line 158, in getuser
    return pwd.getpwuid(os.getuid())[0]
KeyError: 'getpwuid(): uid not found: 5001'

Potentially just have getpass.getuser() then fall back to the UID value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.