Part 2. Install Python software with PIP
2.1 Check the version of python and pip
On BioHPC computers, the "python" command points to "python3.6.7", with "pip" command
linked to this default python. The "python2" command points to "python2.7.15", with "pip2"
command linked to python2.
Before you install any python modules, it is always a good idea to ask these three questions.
1. Which copy of Python installation will you be running?
2. What is the version of the Python?
3. Whether the pip command you are running is associated with the Python you will be
running?
Use the following commands to address these questions:
2.2 Switching default python using "module" command.
To execute python 3.6, you can use the alias "python" as the command or full path command
"/usr/bin/python3.6". Linux "module" function provides an easy way to switch default "python".
2.3 Install and use python module python-dummy
Install a dummy package called "python-dummy" in the directory ~/.local/
Check the directory ~/.local/ to find the newly installed package, you should see the installation
directory "python_dummy-0.1.0.dist-info" and a file "dummy.py"
which python
ls -l /usr/local/bin/python
python -V ##use capital V
which pip
head -n1 /usr/local/bin/pip # the "head -n1" command prints the first line of
a text file
# list the available modules
module avail
# switch default python/pip to version 3.9.6
module load python/3.9.6
which python
which pip
# switch back to default python
module unload python/3.9.6
which python
which pip