A problem I frequently run into when using Python, R, Matlab etc. is installing packages or libraries when I don't have admin privileges on the server I'm using. I was wondering if there is a way to get around this?
I was thinking of "installing" the libraries somewhere in my own account, and adding that directory to my path, rather than somewhere like /usr/bin, /usr/lib etc. Does anyone have any tips / pointers on this? This must be a frequent problem for college / graduate students.
Thanks!
For R you can do install.packages("foo",lib="~/R/") - create the directory ~/R/ first - and then the packages will install there. Then do library(foo,lib="~/R/") to load it.
You can use the .libPaths function in your R startup files to add this automatically. Most of the Ubuntu boxes I've used are set up something like this by default. If a plain user tries to install a package it goes into their ~/R/ library, if root tries to do it, it goes into a site library for everyone.
Since generally there's no point backing up these installed packages, I tend to put my ~/R/ library on a non-backed up part of my filesystem.
[Note the correct use of 'library' here - in R-speak a library is a place where packages are installed]
Install Python / Matlab libraries without admin priviledges?