Sometimes it is useful to install python packages that are not part of psana-python or install particular versions of a software package. These should be done from the "pslogin" machines since they have internet access.
Anaconda
psana now lives in the anaconda environment. You can clone the psana environment into a local environment that you can control with a command like this (which will take some time because it has to copy several GB to the new environment):
conda create -n my-ana-1.3.10 --clone ana-1.3.10
You can see a list of available psana environments (to clone) like this:
conda info --envs
Then activate your new environment with:
source activate my-ana-1.3.10
Then install the conda-python package you want (potentially a specific version) using a command like:
conda install scipy=0.15.0
Note that package version conflicts can make it impossible to install a specific version. One possible way to address this is to remove the package requiring the conflicting version using:
conda remove <packagename>
Virtualenv
NOTE: the virtualenv method is not compatible with our anaconda-based psana, but we leave the documentation here in case it is useful at some point.
A python virtualenv can be used to install python packages locally in your user account. Some instructions are here. Execute this command to create a new virtual environment (after setting up the psana psana environment):
virtualenv <directoryName>
where you replace <directoryName> with the name of the directory you would like to create. Then activate your virtualenv like this:
source <directoryName>/bin/activate.csh #use this for tcsh or source <directoryName>/bin/activate #use this for bash
Use "deactivate" to exit the virtualenv. Install various packages using "pip install <packageName>" as shown in these instructions. Virtualenv packages can be used in batch jobs, but you must submit the job while the environment is active.