Installing Software

How do I install software?

You can install software under your home directory. Most software support installation under non-system locations. If you are building from source, you can change the install location to some directory in your home directory. For instance, in the traditional method of building softwrae from source code, generally called the configure-make-install method, you could set the install location in the configure step using the --prefix= option.

Here is an example of installing a software named foo in a directory named bar (in your home directory) from the source file foo.tar.gz

tar xvzf foo.tar.gz
cd foo
./configure --prefix=~/bar
make
make install

After a successful build, you would find a typical directory structure under the install directory:

bar
├── bin
├── lib
└── share

Now to use this software, you would need to add the install paths for binaries and libraries (at the least) to your environment variables:

export PATH="~/bar/bin:$PATH"
export LD_LIBRARY_PATH="~/bar/lib:$LD_LIBRARY_PATH"

How do I install Python libraries?

You may install Python libraries under your home directory. The easiest way to do this is using pip. If the library is not available via PyPI, you might need to build it from source, using the instructions above.

When installing via pip, the install files go under the .local directory under your home directory. Let’s say you want to install a Python library named foo.

pip3 install foo --user

Now to use this Python module, you would need to add the install paths for binaries and libraries (at the least) to your environment variables (read below if you use one of our environment modules for Python):

export PATH="~/.local/bin:$PATH"
export PYTHONPATH="~/.local/lib/python3.x/site-packages/:$PYTHONPATH"

Once you do that, you should be able to import the Python module.

>>> import foo
>>>

If you have loaded one of the Python bundles via environment modules, you do not need to set the paths above. The modules take care of that automatically.

The Anaconda environment module does not automatically handle user-installed Python paths, so you will need to set the paths appropriately.