In order to install matplotlib to a non default location, I change the file setup.cfg, setting the variable basedirlist.
I do
python setup.py build
and then
python setup.py install
but the last fail because:
copying build/lib.linux-x86_64-2.6/mpl_toolkits/axes_grid1/colorbar.py -> /opt/python/2.6.4/lib/python2.6/site-packages/mpl_toolkits/axes_grid1
error: could not delete '/opt/python/2.6.4/lib/python2.6/site-packages/mpl_toolkits/axes_grid1/colorbar.py': Read-only file system
I am not root, so how can I install matplotlib? is there any other variable I have to set?
Try with an unmodified version of
setup.cfgand runpython setup.py install --helpThere are several options for controlling where the files are installed, the important part of the help message being:Read over those options and choose which one suits you best.
I recommend, however, to use
vertualenv. This sets up, in a directory of your choice, a custom library location and copy of python. All the other libraries (installed by a system admin for example) are available until you install your own copy of the library in this virtualenv.Virtualenv is also a good option if you want to play around with the development version of a library,
matplotlibfor example. Setup a virtualenv for these development libraries, then use the python “executable” associated with that virtualenv to get access to the development version of the library.Check out What's the proper way to install pip, virtualenv, and distribute for Python? to get setup with virtualenv.