Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anaconda is a completely free Python distribution (including for commercial use and redistribution). It includes over 195 of the most popular Python packages for science, math, engineering, data analysis.

Usage

No Format
The usage is:
module load anacondaanaconda3/22019.007.1py3
OR

You will need to activate the environment. For example, to activate biopython

source activate biopython
discardingmodule load anaconda/4.00py2.7
OR:
module load anaconda/4.00py3.5
 
You need to run this after loading the modules:
source /sw/anaconda/2.0.1/bin from PATH
prepending /sw/anaconda/2.0.1/envs/biopython/bin to PATH
No Format
conda create -h
usage: conda create [-h] [--yes] [--dry-run] [-f] [--file FILE] [--unknown]
                    [--no-deps] [-m] [--use-index-cache] [--use-local]
                    [--no-pin] [-c CHANNEL] [--override-channels]
                    [-n NAME | -p PATH] [-q] [--alt-hint] [--clone ENV]
                    [--no-default-packages]
                    [package_spec [package_spec ...]]

Create a new conda environment from a list of specified packages. To use the created environment, use 'source activate envname' look in that directory first.  This command requires either the -n NAME or -p PREFIX option.

positional arguments:
  package_specpy27-ver400/etc/profile.d/conda.sh  #if using module load anaconda/4.00py2.7
OR source /sw/anaconda/py3-ver400/etc/profile.d/conda.sh #if using “module load anaconda/4.00py3.5”

 Manual Usage:
You will need to activate the environment. For example, to activate biopython

source activate biopython
discarding /sw/anaconda/2.0.1/bin from PATH
prepending /sw/anaconda/2.0.1/envs/biopython/bin to PATH

To deactivate this environment, use:
source deactivate

Module Usage:
=============
For example,You can use this to load biopython using python 2.7 version (anaconda) :

module load anaconda/py27biopython1.66


For python 3.5 (anaconda env), use this:
module load anaconda/py35biopython1.66


Anaconda environment need not be loaded separately.
 
However, it can be loaded as follows if needed for other reasons:

module load anaconda/4.00py2.7

module load anaconda/4.00py3.5 




Useful Commands

No Format
To get a list of environment in anaconda:
conda info -e
To create an environment:
conda create -n biopython biopython


De-Activate an environment

source deactivate



Deleting an environment

conda remove -n biopython



No Format
conda create -h
usage: conda create [-h] [--yes] [--dry-run] [-f] [--file FILE] [--unknown]
               package versions to install into conda environment

optional arguments:
  -h, --help [--no-deps] [-m] [--use-index-cache] [--use-local]
            show this help message and exit   [--yes   no-pin] [-c CHANNEL] [--override-channels]
             do not ask for confirmation   [--dry-runn NAME | -p PATH]         only display what would have been done
  -f, --force [-q] [--alt-hint] [--clone ENV]
         force install (even when package already installed),     [--no-default-packages]
                   implies --no-deps
  --file FILE           read package versions from FILE
  --unknown             use index metadata from the local package cache (which
   [package_spec [package_spec ...]]

Create a new conda environment from a list of specified packages. To use the created environment, use 'source activate envname' look in that directory first.  This command requires either the -n NAME or -p PREFIX option.

positional arguments:
  package_spec          package versions to install into conda environment

optional arguments:
  are from unknown channels)-h, --help      --no-deps      show this help message and exit
 do not--yes install dependencies   -m, --mkdir           createdo prefixnot directoryask iffor necessaryconfirmation
  --usedry-index-cacherun     use cache of channel index files   --use-local     only display what would have been done
  -f, --force  use locally built packages   --no-pin   force install (even when package already installed),
    don't use pinned packages   -c CHANNEL, --channel CHANNEL           implies --no-deps
  --file FILE         additional channel toread searchpackage forversions packages.from TheseFILE
are  --unknown             use index metadata from the local package cache (which
 URLs searched in the order they are given (including               are from unknown channels)
  --no-deps    file:// for local directories). Then, the defaults or  do not install dependencies
  -m, --mkdir           create prefix directory if necessary
  channels from .condarc are searched (unless
       --use-index-cache     use cache of channel index files
  --use-local           use locally built packages
  --overrideno-channelspin is given). You can use 'defaults'        don't use pinned packages
  -c CHANNEL, --channel CHANNEL
       to get the default packages for conda, and 'system' to        additional channel to search for packages. These are
          get   the system packages, which also takes .condarc     URLs searched in the order they are given (including
           into account. You can also use any name and the    file:// for local directories). Then, the defaults or
             .condarc channel_alias value will be prepended. The     channels from .condarc are searched (unless
              default channel_alias is http://conda.binstar.org/        --override-channels is given). DoYou notcan searchuse default'defaults'
or .condarc channels. Requires                     to get the default --channel.packages for  -n NAMEconda, --name NAME  name of environment (in /sw/anaconda/2.0.1/envs)
  -p PATH, --prefix PATHand 'system' to
                        get the system packages, which also takes .condarc
   full path to environment prefix (default:                into account. You can also use any name  /sw/anaconda/2.0.1)and the
  -q, --quiet           do not display progress bar   --alt-hint   .condarc channel_alias value will be prepended. The
  Use an alternate algorithm to generate an                default channel_alias is http://conda.binstar.org/
  --override-channels   unsatisfiable hintDo not search default or .condarc channels. Requires
  --clone ENV           path to (or name of) existing local environment   --no-default-packageschannel.
  -n NAME, --name NAME  name of environment (in /sw/anaconda/2.0.1/envs)
  -p PATH, --prefix PATH
       ignore create_default_packages in condarc file  examples:     conda create -n myenv sqlite  

Installation

No Format
bash Anaconda-2.0.1-Linux-x86_64.sh

Anaconda will now be installed into this location:
/root/anacondafull path to environment prefix (default:
          - Press ENTER to confirm the location   - Press CTRL-C to abort the installation
  - Or specify an different location below

[/root/anaconda] >>> /sw/anaconda/2.0.1

PREFIX=/sw/anaconda/2.0.1
installing: python-2.7.7-0 ...
installing: conda-3.5.5-py27_0 ...
installing: conda-build-1.3.5-py27_0 ...
installing: _license-1.1-py27_0 ...
installing: argcomplete-0.6.7-py27_0 ...
installing: astropy-0.3.2-np18py27_0 ...
installing: atom-0.3.7-py27_0 ...
installing: beautiful-soup-4.3.1-py27_0 ...
installing: binstar-0.5.3-py27_0 ...
installing: bitarray-0.8.1-py27_0 ...
installing: blaze-0.5.0-np18py27_1 ...
installing: blz-0.6.2-np18py27_0 ...
installing: bokeh-0.4.4-np18py27_1 ...
installing: boto-2.28.0-py27_0 ...
installing: cairo-1.12.2-2 ...
installing: casuarius-1.1-py27_0 ...
installing: cdecimal-2.3-py27_0 ...
installing: chaco-4.4.1-np18py27_0 ...
installing: colorama-0.2.7-py27_0 ...
installing: configobj-5.0.5-py27_0 ...
installing: cubes-0.10.2-py27_4 ...
installing: curl-7.30.0-0 ...
installing: cython-0.20.1-py27_0 ...
installing: datashape-0.2.0-np18py27_1 ...
installing: dateutil-2.1-py27_2 ...
installing: docutils-0.11-py27_0 ...
installing: dynd-python-0.6.2-np18py27_0 ...
installing: enable-4.3.0-np18py27_2 ...
installing: enaml-0.9.1-py27_1 ...
installing: flask-0.10.1-py27_1 ...
installing: freetype-2.4.10-0 ...
installing: future-0.12.1-py27_0 ...
installing: gevent-1.0.1-py27_0 ...
installing: gevent-websocket-0.9.3-py27_0 ...
installing: greenlet-0.4.2-py27_0 ...
installing: grin-1.2.1-py27_1 ...
installing: h5py-2.3.0-np18py27_0 ...
installing: hdf5-1.8.9-1 ...
installing: ipython-2.1.0-py27_2 ...
installing: ipython-notebook-2.1.0-py27_0 ...
installing: ipython-qtconsole-2.1.0-py27_ /sw/anaconda/2.0.1)
  -q, --quiet           do not display progress bar
  --alt-hint            Use an alternate algorithm to generate an
                        unsatisfiable hint
  --clone ENV           path to (or name of) existing local environment
  --no-default-packages
                        ignore create_default_packages in condarc file

examples:
    conda create -n myenv sqlite

Installation

No Format
bash Anaconda-2.0.1-Linux-x86_64.sh

Anaconda will now be installed into this location:
/root/anaconda

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify an different location below

[/root/anaconda] >>> /sw/anaconda/2.0.1

PREFIX=/sw/anaconda/2.0.1
installing: python-2.7.7-0 ...
installing: itsdangerousconda-03.5.245-py27_0 ...
installing: jdcalconda-build-1.03.5-py27_0 ...
installing: jinja2_license-21.7.21-py27_0 ...
installing: jpeg-8d-argcomplete-0.6.7-py27_0 ...
installing: kiwisolverastropy-0.13.2-py27np18py27_0 ...
installing: launcheratom-0.13.57-py27_0 ...
installing: lcms-1.19-beautiful-soup-4.3.1-py27_0 ...
installing: libdyndbinstar-0.65.23-py27_0 ...
installing: libpngbitarray-10.58.131-1py27_0 ...
installing: libsodiumblaze-0.45.50-0np18py27_1 ...
installing: libtiffblz-40.06.2-np18py27_0 ...
installing: libxml2bokeh-20.94.04-0np18py27_1 ...
installing: libxsltboto-12.128.280-py27_0 ...
installing: llvmcairo-31.12.32-02 ...
installing: llvmpycasuarius-01.12.61-py27_0 ...
installing: lxmlcdecimal-32.3.5-py27_0 ...
installing: markupsafechaco-04.4.181-py27np18py27_0 ...
installing: matplotlibcolorama-10.32.17-np18py27py27_10 ...
installing: mockconfigobj-15.0.15-py27_0 ...
installing: mpi4pycubes-10.10.32-py27_04 ...
installing: mpich2curl-17.430.1p10-0 ...
installing: multipledispatchcython-0.420.31-py27_0 ...
installing: networkxdatashape-10.82.10-py27np18py27_01 ...
installing: nltkdateutil-2.0.41-np18py27py27_02 ...
installing: nosedocutils-10.3.311-py27_0 ...
installing: numbadynd-python-0.136.2-np18py27_0 ...
installing: numexprenable-24.3.10-np18py27_02 ...
installing: numpyenaml-10.89.1-py27_01 ...
installing: openpyxlflask-10.810.51-py27_01 ...
installing: opensslfreetype-12.04.1h10-0 ...
installing: pandasfuture-0.1412.01-np18py27py27_0 ...
installing: patsygevent-1.0.2.1-np18py27py27_0 ...
installing: pep8gevent-1websocket-0.59.63-py27_0 ...
installing: pilgreenlet-10.14.72-py27_10 ...
installing: pipgrin-1.52.61-py27_01 ...
installing: pixmanh5py-02.263.20-np18py27_0 ...
installing: plyhdf5-31.8.49-py27_01 ...
installing: psutilipython-2.1.10-py27_02 ...
installing: pyipython-notebook-2.1.4.200-py27_0 ...
installing: py2cairoipython-qtconsole-2.1.10.0-py27_10 ...
installing: pycosatitsdangerous-0.6.124-py27_0 ...
installing: pycparserjdcal-21.100-py27_0 ...
installing: pycryptojinja2-2.67.12-py27_0 ...
installing: pycurl-7.19.3.1-py27_2jpeg-8d-0 ...
installing: pyfacekiwisolver-40.41.02-py27_0 ...
installing: pyflakeslauncher-0.81.15-py27_0 ...
installing: pygmentslcms-1.619-py27_0 ...
installing: pyparsinglibdynd-20.06.12-py27_0 ...
installing: pyqtlibpng-41.105.413-py27_01 ...
installing: pytableslibsodium-30.14.15-np18py27_0 ...
installing: pytestlibtiff-24.50.2-py27_0 ...
installing: pytzlibxml2-20142.9.30-py27_0 ...
installing: pyyamllibxslt-31.111.28-py27_0 ...
installing: pyzmqllvm-143.3-0 ...
installing: llvmpy-0.12.6-py27_0 ...
installing: qtlxml-43.83.5-py27_0 ...
installing: readlinemarkupsafe-60.218-2py27_0 ...
installing: redismatplotlib-21.63.91-0np18py27_1 ...
installing: redismock-py-21.90.1-py27_0 ...
installing: requestsmpi4py-21.3.0-py27_0 ...
installing: ropempich2-01.94.41p1-py27_10 ...
installing: runipymultipledispatch-0.14.03-py27_0 ...
installing: scikitnetworkx-image-01.108.01-np18py27py27_0 ...
installing: scikitnltk-learn-2.0.14.14-np18py27_10 ...
installing: scipynose-01.143.03-np18py27py27_0 ...
installing: setuptoolsnumba-30.13.62-py27np18py27_0 ...
installing: sipnumexpr-42.153.51-py27np18py27_0 ...
installing: sixnumpy-1.68.1-py27_0 ...
installing: sphinxopenpyxl-1.28.25-py27_0 ...
installing: spyderopenssl-21.30.0rc11h-py27_0 ...
installing: spyderpandas-app-20.314.0rc10-py27np18py27_0 ...
installing: sqlalchemypatsy-0.92.41-py27np18py27_0 ...
installing: sqlitepep8-31.85.4.16-py27_0 ...
installing: ssl_match_hostname-3.4.0.2pil-1.1.7-py27_01 ...
installing: statsmodelspip-01.5.06-np18py27py27_0 ...
installing: sympypixman-0.726.52-py27_0 ...
installing: systemply-53.84-1py27_0 ...
installing: theanopsutil-02.61.01-np18py27py27_0 ...
installing: tkpy-81.54.1520-py27_0 ...
installing: tornadopy2cairo-31.210.10-py27_01 ...
installing: traitspycosat-40.46.01-py27_0 ...
installing: traitsuipycparser-42.4.010-py27_0 ...
installing: ujsonpycrypto-2.6.1.33-py27_0 ...
installing: util-linux-2.21-0pycurl-7.19.3.1-py27_2 ...
installing: werkzeugpyface-04.94.60-py27_0 ...
installing: xlrdpyflakes-0.98.31-py27_0 ...
installing: xlsxwriterpygments-01.5.56-py27_0 ...
installing: xlwtpyparsing-2.0.7.51-py27_0 ...
installing: yamlpyqt-04.110.4-py27_0 ...
installing: zeromqpytables-43.01.41-np18py27_0 ...
installing: zlibpytest-12.25.72-py27_0 ...
installing: anacondapytz-22014.3-py27_0.1-np18py27 ...
installing: pyyaml-3.11-py27_0 ...
installing: _cache-0pyzmq-14.3.0-x0py27_0 ...
Python 2.7.7 :: Continuum Analytics, Inc.
creating default environment...
installation finished.
Do you wish the installer to prepend the Anaconda install location
to PATH in your /root/.bashrc ? [yes|no]
[no] >>> No

Thank you for installing Anaconda!

The binaries are in /sw/anaconda/2.0.1/bin. You can use the module file to load the environment (recommended):

module load anaconda/2.0.1

OR prepend (not advised) to your ~/.bashrc file:
PATH=/sw/anaconda/2.0.1/bin:$PATH

Extra Notes

Dry Run

No Format
To see what packages will be downloaded and/or used in an environment before creating it, you can use the --dry-run option.
conda create --dry-run -n foo2 python

e.g.:

conda create --dry-run -n biopython biopython
Fetching package metadata: ..
Solving package specifications: .
Package plan for installation in environment /sw/anaconda/2.0.1/envs/biopython1.64:installing: qt-4.8.5-0 ...
installing: readline-6.2-2 ...
installing: redis-2.6.9-0 ...
installing: redis-py-2.9.1-py27_0 ...
installing: requests-2.3.0-py27_0 ...
installing: rope-0.9.4-py27_1 ...
installing: runipy-0.1.0-py27_0 ...
installing: scikit-image-0.10.0-np18py27_0 ...
installing: scikit-learn-0.14.1-np18py27_1 ...
installing: scipy-0.14.0-np18py27_0 ...
installing: setuptools-3.6-py27_0 ...
installing: sip-4.15.5-py27_0 ...
installing: six-1.6.1-py27_0 ...
installing: sphinx-1.2.2-py27_0 ...
installing: spyder-2.3.0rc1-py27_0 ...
installing: spyder-app-2.3.0rc1-py27_0 ...
installing: sqlalchemy-0.9.4-py27_0 ...
installing: sqlite-3.8.4.1-0 ...
installing: ssl_match_hostname-3.4.0.2-py27_0 ...
installing: statsmodels-0.5.0-np18py27_0 ...
installing: sympy-0.7.5-py27_0 ...
installing: system-5.8-1 ...
installing: theano-0.6.0-np18py27_0 ...
installing: tk-8.5.15-0 ...
installing: tornado-3.2.1-py27_0 ...
installing: traits-4.4.0-py27_0 ...
installing: traitsui-4.4.0-py27_0 ...
installing: ujson-1.33-py27_0 ...
installing: util-linux-2.21-0 ...
installing: werkzeug-0.9.6-py27_0 ...
installing: xlrd-0.9.3-py27_0 ...
installing: xlsxwriter-0.5.5-py27_0 ...
installing: xlwt-0.7.5-py27_0 ...
installing: yaml-0.1.4-0 ...
installing: zeromq-4.0.4-0 ...
installing: zlib-1.2.7-0 ...
installing: anaconda-2.0.1-np18py27_0 ...
installing: _cache-0.0-x0 ...
Python 2.7.7 :: Continuum Analytics, Inc.
creating default environment...
installation finished.
Do you wish the installer to prepend the Anaconda install location
to PATH in your /root/.bashrc ? [yes|no]
[no] >>> No

Thank you for installing Anaconda!

The binaries are in /sw/anaconda/2.0.1/bin. You can use the module file to load the environment (recommended):

module load anaconda/2.0.1

OR prepend (not advised) to your ~/.bashrc file:
PATH=/sw/anaconda/2.0.1/bin:$PATH

Extra Notes

Dry Run

No Format
To see what packages will be downloaded and/or used in an environment before creating it, you can use the --dry-run option.
conda create --dry-run -n foo2 python

e.g.:

conda create --dry-run -n biopython biopython
Fetching package metadata: ..
Solving package specifications: .
Package plan for installation in environment /sw/anaconda/2.0.1/envs/biopython1.64:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    biopython-1.64             |       np18py27_0         2.1 MB
    python-2.7.8               |                0        11.3 MB
    ------------------------------------------------------------
                                           Total:        13.5 MB

The following packages will be linked:

    package                    |            build
    ---------------------------|-----------------
    biopython-1.64             |       np18py27_0   hard-link
    numpy-1.8.1                |           py27_0   hard-link
    openssl-1.0.1h             |                0   hard-link
    python-2.7.8               |                0   hard-link
    readline-6.2               |                2   hard-link
    sqlite-3.8.4.1             |                0   hard-link
    system-5.8                 |                1   hard-link
    tk-8.5.15                  |                0   hard-link
    zlib-1.2.7                 |                0   hard-link

Dry run: exiting

Create an environment

No Format
conda create -n biopython biopython
Fetching package metadata: ..
Solving package specifications: .
Package plan for installation in environment /sw/anaconda/2.0.1/envs/biopython:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    biopython-1.64             |       np18py27_0         2.1 MB
    python-2.7.8               |                0        11.3 MB
    ------------------------------------------------------------
                                           Total:        13.5 MB

The following packages will be downloadedlinked:

    package                    |            build
    ---------------------------|-----------------
    biopython-1.64             |       np18py27_0   hard-link
    numpy---1.8.1                |           py27_0   hard-link
    biopythonopenssl-1.0.641h             |         np18py27_0       0  2.1 MB hard-link
    python-2.7.8               |                0   hard-link
    11.3 MB
    ------------------------------------------------------------readline-6.2               |                2   hard-link
    sqlite-3.8.4.1        Total:      |       13.5 MB  The following packages will be linked: 0   hard-link
 package   system-5.8                 |            build      ---------------------------|-----------------1   hard-link
    biopythontk-1.648.5.15                  |       np18py27_         0   hard-link
    numpyzlib-1.82.17                 |            py27_    0   hard-link

Proceed ([y]/n)? y
 opensslFetching packages ...
biopython-1.0.1h64 100% |##########################| Time: 0:00:15 144.95 kB/s
python-2.7.8-0 100% |##########################| Time: 0:00:14  |    821.86 kB/s
Extracting packages ...
[      COMPLETE      0] |#######################| 100%
hard-linkLinking     python-2.7.8 packages ...
[      COMPLETE      ]  |#######################| 100%
#
# To activate this environment, use:
# $ source activate biopython
#
# 0To deactivate this hard-link
    readline-6.2               |                2   hard-link
    sqlite-3.8.4.1             |                0   hard-link
    system-5.8                 |                1   hard-link
    tk-8.5.15environment, use:
# $ source deactivate
#

Installed Environment

No Format


Useful commands

No Format
Useful commands:
 
conda info --envs
conda list
conda activate

Sample PBS file

No Format
#!/bin/bash
#PBS -N condatest
#PBS -m abe
#PBS -M YourEMAIL@griffith.edu.au
#PBS -l select=1:ncpus=1:mem=4gb,walltime=10:00:00
module load anaconda/4.00py2.7
source /sw/anaconda/py27-ver400/etc/profile.d/conda.sh 
##use /sw/anaconda/py3-ver400/etc/profile.d/conda.sh if using “module load anaconda/4.00py3.5”
echo "Starting job: "
cd  $PBS_O_WORKDIR
python <pythonFile>
 
>>>An example of the python file>>>>>>>>> 
cat pythonFile.py
import tensorflow as tf
>>>>>>>>>>>>>> 


Activate an environment

No Format
source /sw/anaconda/py27-ver400/etc/profile.d/conda.sh
OR source /sw/anaconda/py3-ver400/etc/profile.d/conda.sh if using “module load module load anaconda/4.00py3.5”
source activate biopython

e.g:

source activate biopython
discarding /sw/anaconda/2.0.1/bin from PATH
prepending /sw/anaconda/2.0.1/envs/biopython/bin to PATH

De-Activate an environment

No Format
source deactivate

Deleting an environment

No Format
conda remove -n biopython


n060 anaconda installation

No Format
module load anaconda/5.3.1py3

conda info --envs
# conda environments:
#
base                  |*    /sw/centos7/anaconda/5.3.1/py3
accelerate            0   hard-link
    zlib-1.2.7 /sw/centos7/anaconda/5.3.1/py3/envs/accelerate
biopython                | /sw/centos7/anaconda/5.3.1/py3/envs/biopython
deeplearning               0   hard-link

Dry run: exiting

Create an environment

No Format
conda create -n biopython biopython
Fetching package metadata: ..
Solving package specifications: .
Package plan for installation in environment /sw/anaconda/2.0.1/envs/biopython:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    biopython-1.64             |       np18py27_0         2.1 MB
    python-2.7.8               |                0        11.3 MB
    ------------------------------------------------------------
                                           Total:        13.5 MB

The following packages will be linked:

    package/sw/centos7/anaconda/5.3.1/py3/envs/deeplearning
keras                    /sw/centos7/anaconda/5.3.1/py3/envs/keras
tensorflow-gpu           /sw/centos7/anaconda/5.3.1/py3/envs/tensorflow-gpu

e.g
module load anaconda/5.3.1py3
source activate keras
pip install soundfile

Installing packages without root access

No Format
Instructions from: https://medium.com/@danielwzou/installing-spacy-and-other-packages-without-sudo-or-root-privileges-using-anaconda-59571ec0ecad

First, navigate to your home directory.
module load anaconda/5.3.1py3
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
sh Miniconda3-latest-Linux-x86_64.sh
Now, we have a local installation of the Conda package manager at ~/miniconda3
Let’s add conda to our bash profile so that we can call it from the command line
vim .bash_profile
i
Add this line to the file:
export PATH=$HOME/miniconda3/bin:$PATH
esc :wq
Now, let’s reload our .bash_profile
source .bash_profile
And check that our installation was completed successfully
which conda
Which should return ~/miniconda3/bin/conda
Now that Conda is installed, we can install Spacy or other Python packages
conda install spacy
python -m spacy download en
Now, let’s make sure that Spacy is installed correctly
python
import spacy
nlp = spacy.load('en')
doc = nlp(u'Hello World!')
print([w.lemma_ for w in doc])
Now that you have Conda installed, you can use it to install many packages locally.


Anaconda on the new cluster

No Format
module load anaconda3/2019.07py3
 
This should have packages like the tensorflow env. You can find with this:
conda info --envs
 
>>>>> 
conda info --envs
# conda environments:
#
                           |/sw/anaconda2/2019.07/envs/bio
            build     ---------------------------|-----------------        biopython-1.64/sw/anaconda2/2019.07/envs/bioinfoPy27
base                  *  /sw/anaconda3/2019.07
3point6   |       np18py27_0   hard-link     numpy-1.8.1/sw/anaconda3/2019.07/envs/3point6
R                        | /sw/anaconda3/2019.07/envs/R
bioinformatics          py27_0   hard-link
    openssl-1.0.1h             |                0   hard-link
    python-2.7.8 /sw/anaconda3/2019.07/envs/bioinformatics
 
>>>>>>> 
This will give the packages in the base:
conda list
 
source activate 3point6
Next run: " conda list"
This will list the packages installed in that environment.
 
It shows among many others:
pytorch                |   1.3.1           cuda100py36h53c1284_0
 0
tensorboard  hard-link     readline-6.2        2.0.0       |       pyhb230dea_0
tensorflow        2   hard-link     sqlite-32.80.4.10           mkl_py36hef7ec59_0
tensorflow-base |          2.0.0      0   hard-link  mkl_py36h9204916_0
tensorflow-estimator  system-5.8    2.0.0             | pyh2649769_0
termcolor              1   hard-link1.1.0     tk-8.5.15                  py_2 |   conda-forge
theano            0   hard-link     zlib-1.2.70.4           py36hf484d3e_1000    conda-forge
 
Remember this cluster has no GPU (currently)


Another sample pbs file


No Format
#!/bin/bash
#PBS |-N condatest
#PBS -m abe
#PBS -M YourEMAIL@griffith.edu.au
#PBS -l select=1:ncpus=1:mem=4gb,walltime=10:00:00
cd  $PBS_O_WORKDIR
module  0   hard-link

Proceed ([y]/n)? y
Fetching packages ...
biopython-1.64 100% |##########################| Time: 0:00:15 144.95 kB/s
python-2.7.8-0 100% |##########################| Time: 0:00:14 821.86 kB/s
Extracting packages ...
[      COMPLETE      ] |#######################| 100%
Linking packages ...
[      COMPLETE      ] |#######################| 100%
#
# To activate this environment, use:
# $ source activate biopython
#
# To deactivate this environment, use:
# $ source deactivate
#

Activate an environment

No Format
source activate biopython

e.g:

source activate biopython
discarding /sw/anaconda/2.0.1/bin from PATH
prepending /sw/anaconda/2.0.1/envs/biopython/bin to PATH

De-Activate an environment

No Format
source deactivate

Deleting an environment

No Format
conda remove -n biopython
load anaconda3/2019.07py3 
source activate bioinformatics
trinity <trinityinput>



Sample python code to write out a plot


Code Block
vi plot.py
>>>>>>>>>>>>>>>>>
import matplotlib.pyplot as plt
import numpy as np

np.random.seed(19680801)
data = np.random.randn(2, 100)

fig, axs = plt.subplots(2, 2, figsize=(5, 5))
axs[0, 0].hist(data[0])
axs[1, 0].scatter(data[0], data[1])
axs[0, 1].plot(data[0], data[1])
axs[1, 1].hist2d(data[0], data[1])

plt.show()
plt.savefig('test')
>>>>>>>>>>>>>>>>>>

module load anaconda3/2022.10
source activate yourenv #this should have the matlibplot packages and others.
python plot.py  would generate a plot named test.png

Reference: https://matplotlib.org/3.4.3/tutorials/introductory/sample_plots.html
Sample codes are here:
https://matplotlib.org/3.4.3/_downloads/55a714c8a6e4dde456b09326202fe492/sample_plots.py

https://matplotlib.org/3.4.3/_downloads/003118d8eb1e7df55671bcdf18bfac3c/sample_plots.ipynb



Ref: https://medium.com/@danielwzou/installing-spacy-and-other-packages-without-sudo-or-root-privileges-using-anaconda-59571ec0ecad

Reference

1. http://davebehnke.com/using-python-anaconda-distribution.html
2. https://store.continuum.io/cshop/anaconda/

3. https://medium.com/@danielwzou/installing-spacy-and-other-packages-without-sudo-or-root-privileges-using-anaconda-59571ec0ecad
4.
http://continuum.io/downloads#all