We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
getpass.getuser()
The text was updated successfully, but these errors were encountered:
Something like:
try: username = getpass.getuser() except KeyError: username = str(os.getuid()) tempdir = os.path.join(tempdir, 'matplotlib-%s' % username)
Sorry, something went wrong.
Looks good to me. Will you make that change in a Pull Request?
Fix issues with getting tempdir when unknown uid
c041352
Closes matplotlib#5940
Bump matplotlib version because of specific Docker usage
e976560
See matplotlib/matplotlib#5940
Require more recent version of Matplotlib
01865db
See: matplotlib/matplotlib#5940
No branches or pull requests
I am trying to use matplotlib inside a Docker container running as non root. When I do I get the following:
Potentially just have
getpass.getuser()
then fall back to the UID value.The text was updated successfully, but these errors were encountered: