New issue
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
Matplotlib requires sudo on Ubuntu 14.04 for me #3960
Comments
Are the user names the same on both systems? I also find it curious that it On Thu, Jan 1, 2015 at 11:17 AM, skarthikkrishna92 <notifications@github.com
|
@WeatherGod - I remember making sure that the user names on both systems were the same. I don't have access to the other system right now, so I can't be one hundred percent sure. I'll find the answers to both the questions and update the thread as soon as I get my hands on my old system |
In transferring your identity and files from one machine to another, it is not just a matter of user name and group name, but also of their respective numbers, UID and GID, set in the /etc/passwd and /etc/group files. Try this: use the standard gui tool (whatever is provided with the desktop environment you are using) to create a new user account with some other name. Then log out of your present account and into the new one, and try running something in matplotlib. You should find that it is no longer using /tmp, but a newly-created subdirectory in your home directory. I think the cache dir should be ~/.cache, but this can be changed depending on your environment variables. You can see what it is in your test user account, and then check to see if this can be created and is writable in your real user account. |
@efiring, if that is the issue, What really confused me is, that writing to the folder in Anyway it might be a good idea to catch this case and report permission issues. In my opinion, if matplotlib cannot write to its config directory, this is probably always a bad sign. The fallback to the tmp directory is fine, but an explicit warning about permission issues might be a good idea. |
I'd be 👍 on that idea. I'll close this original issue, but if you wanted to get involved and submit a PR for the warning, I think it would be a welcome addition. Thanks! |
@cel4 - Sorry I couldn't get back earlier. I've tried taking control of the config folder using |
I had the issue, fixed it by deleting |
@aberaud +1 works for me |
I am having this issue with a system user when I am trying to make my app a *nix daemon. The system user is running the program and this system user does not have a /home/[user] file since it is a system user. Now the system user is able to make files in the /tmp dir but it looks as if matplotlib is not making the tmp dir before trying to use it.
My work around is going to be to make this a account instead of a system service account but this is not ideal. |
Can't reproduce:
|
I got it to work with the service account. Seemed to be a supplemental group I needed to add to that service account. |
I recently shifted to a new laptop. After installing Ubuntu 14.04 LTS and all of the packages that my previous system contained, I copied all my files from my old system to the new one.
Whenever I try executing any python code that has a matplotlib call, I get the following error
From what I've been able to try, this problem seems to crop up because the code cannot access /tmp/ for writing onto it. The code runs just fine when I add a sudo tag before the execution command.
I'm curious as to why this is happening now. All the packages on my old and new laptop, especially the pyplot package are the same. I haven't missed out on installing any package, nor has there been any update that is not reflected in one of the systems. The code runs just fine in my old laptop. It refuses to work without sudo in the new one. I'd appreciate it if someone could help me out on that
A few details, if they are relevant:
Both systems run Ubuntu 14.04 LTS, last upgraded on 26th Dec, 2014.
I'm running Python 2.7.6 on both systems. [It's a mandated requirement for most of my coursework]
Matplotlib version installed on both systems is 1.3.1
EDIT :
The output of
ls -ld /tmp/
isThe output of
ls -ld /tmp/matplotlib-skarthikkrishna
isThe output remains the same with and without sudo, if at all that is relevant.
I used
sudo apt-get install python-matplotlib
to install matplotlib on both systemsThe output of
python -c "import matplotlib; print(matplotlib.get_configdir())"
is/home/skarthikkrishna/.config/matplotlib
The output of
python -c "import matplotlib;print(matplotlib.get_cachedir())"
is/tmp/matplotlib-skarthikkrishna
All the permission have been set appropriately to the best of my knowledge, but I'm not very sure about that. The stackoverflow thread for this is located at
https://stackoverflow.com/questions/27667641/matplotlib-requires-sudo-on-ubuntu-14-04
The text was updated successfully, but these errors were encountered: