Many programming languages and applications have extensions (aka add-ons, modules or packages) that can be installed in a users home directory. See the list to the left of applications that allow users to install add-ons.
Conda is a package manager application that quickly installs, runs, and updates packages and their dependencies. It can query and search the package index and current installation, and install and update packages into existing conda environments. Conda is only aware of a subset of Python packages, and is not meant as a replacement to pip.
A virtual environment is a named, isolated, working copy of Python that that maintains its own files, directories, and paths so that you can work with specific versions of libraries or Python itself without affecting other Python projects. Conda is also an environment manager application. For example, you may have one environment with NumPy 1.7 and its dependencies, and another environment with NumPy 1.6 for legacy testing. If you change one environment, your other environments are not affected. You can easily activate or deactivate (switch between) these environments.
For example, to create an Python 3.6 environment with the Pandas version of 0.19 and its dependencies, open the Anaconda shell from the RCE applications menu, then issue these commands:
conda create --name mypandas019 python=3.6 pandas=0.19
source activate mypandas019
You can find full documentation for using Conda at https://conda.io/docs/using/envs.html.
We also have additional documentation for using Anaconda Python in the RCE.
If you install a module using conda, you can make it available to a limited set of conda environments if you so choose. If you install a module with pip, it automatically becomes available in all conda environments [for that version of Python].
As an RCE user, you have the ability to install Python modules locally to your home directory and use them in your projects.
pip list | grep $MODULE
pip list | grep simplejson
pip install $MODULE --user
pip install simplejson --user
import simplejson
, did not work from a Python interactive console, you may have the wrong name. Often Python class names differ from Python module names. Try using the pip search
feature.
Here's an example of installing the Python module 'rtree' by compiling it from source.
The library libspatialindex 1.7 is required for package 'rtree'. Only version 1.6 is available for CentOS 6, unfortunately. You can try building the package in your home directory.
Python has trouble finding the libspatialindex library and this is a known bug for which there was a specific fix implemented. You can find more on the discussion here: https://github.com/Toblerity/rtree/issues/56.
Unfortunately, the details of how to use the fix are poorly documented. The name of the environmental variable looks like it changed between the discussion, where it's referred to as SPATIALINDEX_LIBRARY_PATH; however, the sequence of commands above seem to work.
The RCE provides almost all stable libraries maintained in the Comprehensive R Archive Network (CRAN), and others. For a full list refer to "Which R packages are available?"
If you would like to install a library separately for your own personal use, follow these instructions:
In R, type library(<package_name>).
For example, to install R Commander, type the following:
> library(Rcmdr)
R prompts you with a warning if the package that you chose to install uses other packages that are not installed already.
To install missing packages on which your target package depends:
Click Yes to continue. The Install Missing Packages window is displayed.
Click OK to continue. R prompts you to select a mirror site from which to download the packages' sources.
Select a site from which to download the sources, and then click OK.
The dependent packages and your target package are now installed. If it is an executable, the function is executed.
Alternatively, you can install packages from within R like this:
install.packages("package_name")
If the R package fails to compile, you may need a newer version of GCC. See this page for using updated versions of developer tools.
Start Stata on the RCE by going to Applications->RCE Powered Applications->RCE Powered Stata.
Once stata is running, you can do one of the following:
ssc install <package-name>
eg. ssc install outreg
For more information on ssc you can check out this Stata help page
net install <package-name>, from(SOME.SITE.EDU/package-name) replace
For example to install a package named rdrobust, you can submit:
net install rdrobust, from(http://www-personal.umich.edu/~cattaneo/rdrobust/stata) replace