Follow the instructions about the conda-based versions of UV-CDAT initialization for actually using an installed version of 8.0
The steps below are adapted from the older (but with lots of extra and possibly useful details) installing miniconda instructions
cd /home/scratch01/<your_login>
C:\Scratch\<your_login>
directory:cd /mnt/c/Scratch/<your_login>
wget
to download the installer:wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
(90 Mb, 26 Feb 2021)bash Miniconda3-latest-Linux-x86_64.sh
Do you wish the installer to initialize Miniconda3 by running conda init? [yes|no]
⇒ NO/home/share/unix_files/cdat/miniconda3
, or another subdirectory of /home/share/unix_files/cdat/
/data/jypmce/cdat/miniconda3
, or another sub-directory of /data/jypmce/cdat/
/home/
does not work (e.g. /mnt/h/CDAT/miniconda3
,assuming there is a H:\CDAT\
directory, does not work)/home/<your_login>/miniconda3
miniconda3
directory size is 342M> du -sh miniconda3 342M miniconda3 > cd miniconda3 > du -sh * 20M bin 0 compiler_compat 4.0K condabin 684K conda-meta 0 envs 16K etc 5.5M include 4.0K info 198M lib 12K LICENSE.txt 114M pkgs 604K share 4.0K shell 0 ssl 0 x86_64-conda_cos6-linux-gnu
source <installation_path>/miniconda3/etc/profile.d/conda.sh
source <installation_path>/miniconda3/etc/profile.d/conda.csh
conda
command, and use it to initialize the base environment$ which conda <installation_path>/miniconda3/condabin/conda $ which python /usr/bin/python $ conda activate (base) $ which python <installation_path>/miniconda3/bin/python
$ conda update --all [...]
miniconda3
directory size goes from 432 Mb to 581 Mb. This directory will keep on growing, which is the reason why you should put it on a (preferably non backed up) disk where you have enough spaceconda
(just in case we did not get it with the update)conda update -n base -c defaults conda
rm Miniconda3-latest-Linux-x86_64.sh
The idea is to remove the miniconda3 initialization lines that were automatically added at the end of .bashrc
and put them (and other useful commands) in a special initialization file, that can be sourced only when we actually want to use conda and CDAT (in order to avoid potentiel side effects)
Note: this is the new conda activate some_version
style
See the ~jypeter/.conda3_jyp.sh
file below, and how to use it, in a bash shell. In a tcsh shell, see the ~jypeter/.conda3_jyp.csh
further down. In both shell cases, if you are installing your own version of python, you need to use your own location of the initialization files in the source
lines, and you can use another file name than conda3_jyp
$ which python /usr/bin/python $ cat ~jypeter/.conda3_jyp.sh # Conda initialization by JYP, NEW style # # Use this for working with conda and CDAT centrally managed by JYP # # Execute this file in a BASH shell with # source path/this_file # Then get the list of available python distributions with # conda env list # Then activate a specific distribution with # conda activate version_name # # More details in: # https://wiki.lsce.ipsl.fr/pmip3/doku.php/other:python:starting#conda-based_versions_of_uv-cdat # https://wiki.lsce.ipsl.fr/pmip3/doku.php/other:uvcdat:conda_notes # # Jean-Yves Peterschmitt - LSCE - 11/2018 source /home/share/unix_files/cdat/miniconda3/etc/profile.d/conda.sh # Use the alias below to easily determine where your python # interpreter is located alias wp="which python" # Where are ALL the python interpreters in the search path alias wpa="which -a python" # The end $ source ~jypeter/.conda3_jyp.sh $ conda activate (base) $ which python /home/share/unix_files/cdat/miniconda3/bin/python
tcsh shell usage example
>which python /usr/bin/python >cat ~jypeter/.conda3_jyp.csh # Conda initialization by JYP, NEW style # # Use this for working with conda and CDAT centrally managed by JYP # # Execute this file in a TCSH shell with # source path/this_file # Then get the list of available python distributions with # conda env list # Then activate a specific distribution with # conda activate version_name # # More details in: # https://wiki.lsce.ipsl.fr/pmip3/doku.php/other:python:starting#conda-based_versions_of_uv-cdat # https://wiki.lsce.ipsl.fr/pmip3/doku.php/other:uvcdat:conda_notes # # Jean-Yves Peterschmitt - LSCE - 11/2018 source /home/share/unix_files/cdat/miniconda3/etc/profile.d/conda.csh # Use the alias below to easily determine where your python # interpreter is located alias wp "which python" # The end >source ~jypeter/.conda3_jyp.csh >conda activate (base) >which python /home/share/unix_files/cdat/miniconda3/bin/python
You probably don't want to type the source line each time you need to use your conda based python, so you can add a source ~jypeter/.conda3_jyp.sh
line in your ~/.bashrc
file, and source ~jypeter/.conda3_jyp.csh
line in your ~/.cshrc
file. Then, when you need a specific python environment, just type conda activate name_of_the_specific_environment
The old style notes below are just for reference sake and you can skip them
Note: this is the old source activate some_version
style
See the ~jypeter/.conda3old_jyp.sh
file below, and how to use it, in a bash shell
bash-4.2$ which python /usr/bin/python $ cat .conda3old_jyp.sh # Conda initialization by JYP, OLD style # # Use this for working with conda and CDAT centrally managed by JYP # # Execute this file in a BASH shell with # source path/this_file # Then get the list of available python distributions with # conda env list # Then activate a specific distribution with # source activate version_name # # More details in: # https://wiki.lsce.ipsl.fr/pmip3/doku.php/other:python:starting#conda-based_versions_of_uv-cdat # https://wiki.lsce.ipsl.fr/pmip3/doku.php/other:uvcdat:conda_notes # # Jean-Yves Peterschmitt - LSCE - 11/2018 export PATH="/home/share/unix_files/cdat/miniconda3/bin:$PATH" # Use the alias below to easily determine where your python # interpreter is located alias wp="which python" # Where are ALL the python interpreters in the search path alias wpa="which -a python" # The end $ source ~jypeter/.conda3old_jyp.sh $ wp /home/share/unix_files/cdat/miniconda3/bin/python
$ conda create -n cdat-8.0_py2 -c cdat/label/v80 -c conda-forge -c cdat python=2.7 cdat # Generate the list of installed packages $ conda list -n cdat-8.0_py2 > /home/scratch01/jypeter/cdat-8.0_py2_list_181108.txt
List of installed packages: cdat-8.0_py2_list_181108.txt
Disk space after 8.0 installation
$ du -sh /home/share/unix_files/cdat/miniconda3 4.3G /home/share/unix_files/cdat/miniconda3 $ du -sh /home/share/unix_files/cdat/miniconda3/* 15M /home/share/unix_files/cdat/miniconda3/bin 2.4M /home/share/unix_files/cdat/miniconda3/compiler_compat 4.0K /home/share/unix_files/cdat/miniconda3/conda-bld 3.7M /home/share/unix_files/cdat/miniconda3/conda-meta 2.8G /home/share/unix_files/cdat/miniconda3/envs 28K /home/share/unix_files/cdat/miniconda3/etc 4.9M /home/share/unix_files/cdat/miniconda3/include 156M /home/share/unix_files/cdat/miniconda3/lib 8.0K /home/share/unix_files/cdat/miniconda3/LICENSE.txt 1.4G /home/share/unix_files/cdat/miniconda3/pkgs 1.3M /home/share/unix_files/cdat/miniconda3/share 24K /home/share/unix_files/cdat/miniconda3/ssl 12K /home/share/unix_files/cdat/miniconda3/x86_64-conda_cos6-linux-gnu $ du -sh /home/share/unix_files/cdat/miniconda3/envs/* 2.8G /home/share/unix_files/cdat/miniconda3/envs/cdat-8.0_py2
$ conda create -n cdat-8.0_py3 -c cdat/label/v80 -c conda-forge -c cdat python=3.6 cdat
Notes:
$ conda create -n cdat-nightly_py2 -c cdat/label/nightly -c conda-forge -c cdat python=2.7 cdat
Not tested! Can this be updated with conda update -n cdat-nightly_py2 -c cdat/label/nightly -c conda-forge -c cdat –all
???
$ conda create -n cdat-nightly_py3 -c cdat/label/nightly -c conda-forge -c cdat python=3.6 cdat
This section is about the creation of the cdatm17 environment
Notes about actually using the cdatm17 conda-based python
Note: using hard links, cloning a full environment only adds an extra 582M of disk space
$ conda create -n cdatm17_py2 --clone cdat-8.0_py2 Source: /home/share/unix_files/cdat/miniconda3/envs/cdat-8.0_py2 Destination: /home/share/unix_files/cdat/miniconda3/envs/cdatm17_py2 Packages: 226 Files: 3 [...] $ du -sh /home/share/unix_files/cdat/miniconda3/envs/* 2.5G /home/share/unix_files/cdat/miniconda3/envs/cdat-8.0_py2 392M /home/share/unix_files/cdat/miniconda3/envs/cdatm17_py2 839M /home/share/unix_files/cdat/miniconda3/envs/cdat-nightly_py2
conda create -n cdatm-nightly_py2 --clone cdat-nightly_py2
cdatm
link, make sure that the new version is stable and working correctly before updating the cdatm
link
We create a cdatm symbolic link in the envs
directory, that has a stable name but can be moved to point to the latest default CDAT. In that case, most users can just activate this cdatm version and always get the latest stable version
$ cd /home/share/unix_files/cdat/miniconda3/envs $ conda env list base * /home/share/unix_files/cdat/miniconda3 cdat-8.0_py2 /home/share/unix_files/cdat/miniconda3/envs/cdat-8.0_py2 cdatm17_py2 /home/share/unix_files/cdat/miniconda3/envs/cdatm17_py2 $ ln -s cdatm17_py2 cdatm $ conda env list base * /home/share/unix_files/cdat/miniconda3 cdat-8.0_py2 /home/share/unix_files/cdat/miniconda3/envs/cdat-8.0_py2 cdatm /home/share/unix_files/cdat/miniconda3/envs/cdatm cdatm17_py2 /home/share/unix_files/cdat/miniconda3/envs/cdatm17_py2 $ source activate cdatm (cdatm) bash-4.2$ conda env list base /home/share/unix_files/cdat/miniconda3 cdat-8.0_py2 /home/share/unix_files/cdat/miniconda3/envs/cdat-8.0_py2 cdatm * /home/share/unix_files/cdat/miniconda3/envs/cdatm cdatm17_py2 /home/share/unix_files/cdat/miniconda3/envs/cdatm17_py2
You should download the test data (174M of data…) and use it in the example scripts that you want to distribute, and scripts you write for reporting the errors you find (if any…)
$ source activate cdatm17_py2 (cdatm17_py2) $ python -c 'import vcs; vcs.download_sample_data_files(); print "\nFinished downloading sample data to", vcs.sample_data' [...] Finished downloading sample data to /home/share/unix_files/cdat/miniconda3/envs/cdatm17_py2/share/uvcdat/sample_data (cdatm17_py2) $ du -sh /home/share/unix_files/cdat/miniconda3/envs/cdatm17_py2/share/uvcdat/sample_data 174M /home/share/unix_files/cdat/miniconda3/envs/cdatm17_py2/share/uvcdat/sample_data
After cloning, we are ready to install some extra packages that may be requested by LSCE users
conda install
or pip install
# Keep a trace of what will be installed $ conda install --dry-run -n cdatm17_py2 -c conda-forge pillow pandas statsmodels seaborn scikit-image seawater gsw netcdf4 pyferret basemap-data-hires xlsxwriter cmocean rpy2 gdal windspharm > /home/scratch01/jypeter/lsce-extra_01_install_190304.txt # Install... $ conda install -n cdatm17_py2 -c conda-forge pillow pandas statsmodels seaborn scikit-image seawater gsw netcdf4 pyferret basemap-data-hires xlsxwriter cmocean rpy2 gdal windspharm [...] # Install extra packages in the nightly version (if you need 'nightly') $ conda install -n cdatm-nightly_py2 -c conda-forge pillow pandas statsmodels seaborn scikit-image seawater gsw netcdf4 pyferret basemap-data-hires xlsxwriter cmocean rpy2 gdal windspharm # Check the disk space after installation $ du -sh /home/share/unix_files/cdat/miniconda3 7.5G /home/share/unix_files/cdat/miniconda3 $ du -sh /home/share/unix_files/cdat/miniconda3/envs/* 2.5G /home/share/unix_files/cdat/miniconda3/envs/cdat-8.0_py2 1.2G /home/share/unix_files/cdat/miniconda3/envs/cdatm17_py2 938M /home/share/unix_files/cdat/miniconda3/envs/cdatm-nightly_py2 450M /home/share/unix_files/cdat/miniconda3/envs/cdat-nightly_py2
List of installed packages: lsce-extra_01_install_190304.txt
Packages installed with pip
pip install dreqPy
pip install --upgrade dreqPy
$ drq -v dreqPy version 01.00.29 [Version 01.00.29]
The following packages have no dependency problems and were installed (or updated) later
conda install -n cdatm17_py2 -c conda-forge -c vacumm vacumm
conda install -n cdatm17_py2 -c stefraynaud -c conda-forge spanlib
python -c 'from spanlib.analyzer import Analyzer'
Add here packages that would be useful and have not been installed yet, or have some problems that prevent their installation
conda install -n cdatxxx -c conda-forge iris
conda install -n cdatxxx -c conda-forge wrf-python
top
)conda install -n cdatxxx -c conda-forge glances
Some packages change more often than others, and can be easily updated the following way:
conda update -n cdatxxx -c conda-forge -c pcmdi -c uvcdat cmor
python -c 'from cmor import *; print CMOR_VERSION_MAJOR, CMOR_VERSION_MINOR, CMOR_VERSION_PATCH'
pip install --upgrade dreqPy
drq -v
The CLIMAF installation is a special case, because we may want to use it with the Python installed for CDAT, but it is not installed using conda
We follow the steps for the installation of a non-standard server
cd /home/share/unix_files/cdat
/data/jypmce/cdat/
git clone https://github.com/senesis/climaf climaf
setenv PYTHONPATH ${PYTHONPATH}:/home/share/unix_files/cdat/climaf
export PYTHONPATH=${PYTHONPATH}:/home/share/unix_files/cdat/climaf
/data/jypmce/cdat/climaf
module load netcdf/4 nco cdo ncl ncview
module load netcdf4 nco cdo ncl/6.3.0
cd climaf/testing ./test_install.sh
.basrc
and .cshrc
files. Note: maybe these lines should go to the .profile
and .login
files…(check Bash Startup Files) # Prerequisites for using CLIMAF module load netcdf/4 nco cdo ncl ncview # CLIMAF environment variables setenv CLIMAF /home/share/unix_files/cdat/climaf setenv PYTHONPATH "${PYTHONPATH}:${CLIMAF}" #setenv PYTHONPATH $CLIMAF setenv PATH "${PATH}:${CLIMAF}/bin" setenv CLIMAF_CACHE "/home/scratch01/${USER}/climaf_cache" setenv TMPDIR $CLIMAF_CACHE setenv CLIMAF_LOG_DIR $CLIMAF_CACHE #conda activate cdatm-nightly_py2
# Prerequisites for using CLIMAF when not using the # default 'module load climaf' module load netcdf4 nco cdo ncl/6.3.0 # CLIMAF environment variables export CLIMAF=/data/jypmce/cdat/climaf #export PYTHONPATH=$PYTHONPATH:$CLIMAF export PYTHONPATH=$CLIMAF export PATH=$PATH:$CLIMAF/bin export CLIMAF_CACHE=/data/jypmce/climaf_cache export TMPDIR=$CLIMAF_CACHE export CLIMAF_LOG_DIR=$CLIMAF_CACHE #conda activate cdatm-nightly_py2
Some packages may have files that can only be read by the person who installed CDAT and the LSCE extensions (eg pcmdi-metrics in 2.8.0 and cdp in 2.10)
We check if some of the installed files are missing read access for the group or other, and we manually change the permissions
>find /home/share/unix_files/cdat/miniconda3/envs \! -perm /g+r,o+r -ls # Everything OK!
basemap
dreqPy
After following the steps above, we get the following environments. Use the conda info --envs
or the conda env list
command to get the up-to-date list of available environments
Environment name | Server | conda list |
---|---|---|
cdat-8.0_py2 | LSCE | |
cdatm17_py2 | LSCE | |
cdat-nightly_py2 | LSCE ciclad | |
cdatm-nightly_py2 | LSCE ciclad |
[ PMIP3 Wiki Home ] - [ Help! ] - [ Wiki syntax ]