python - MPLCONFIGDIR error in matplotlib -


when try import matplotlib.pyplot following error:

runtimeerror("'%s' not writable dir; must set %s/.matplotlib writable dir.  can set environment variable mplconfigdir writable directory want matplotlib data stored "% (h, h)) 

i have .matplotlib directory in home directory owned me , has write permissions on. why telling me "not writable dir" , how fix this?

don't run python root; not safe, , potentially run more permissions issues later. instead, make sure own home directory , matplotlib directory:

sudo chown $user ~ ~/.matplotlib 

Comments