Changes between Version 15 and Version 16 of cypress/AnacondaInstallPackage


Ignore:
Timestamp:
10/15/25 12:46:03 (9 hours ago)
Author:
fuji
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • cypress/AnacondaInstallPackage

    v15 v16  
    88}}}
    99
    10 'conda' is the command to add packages to Anaconda python distribution. However, since you don't have permission in /share/apps/anaconda, it won't work.
    11 There is a workaround. Here, for example, we want to add 'vtk' python wrapper library. You try:
     10'conda' is the command to add packages to the Anaconda Python distribution. However, since you don't have permission in /share/apps/anaconda, it won't work.
     11There is a workaround. Here, for example, we want to add 'mpi4py' Python wrapper library for MPI. You try:
    1212
    1313 {{{
    14 conda install vtk
     14conda install mpi4py
    1515}}}
    1616
    17 But you will see an error message due to your lack of write permission to the shared directory such as the following.
     17But you will see an error message due to your lack of write permission to the shared directory, such as the following.
    1818
    1919
     
    2525}}}
    2626
    27 To avoid the above error, you'll have to clone the python environment. By default, your conda environments are located in your home directory. But, we recommend you to use your group project directory. Setting the CONDA_ENVS_PATH environment variable will tell Anaconda where to place and look for your conda environments. For example:
     27To avoid the above error, you'll have to clone the Python environment. By default, your conda environments are located in your home directory. But, we recommend that you use your group project directory. Setting the '''CONDA_ENVS_PATH''' environment variable will tell Anaconda where to place and look for your conda environments. For example:
    2828
    2929{{{
     
    3131}}}
    3232
    33 will put your conda environments at the folder /lustre/project/mygroup/myuser/conda-envs (you may have to create this folder if it does not exist).
     33will put your conda environments in the folder /lustre/project/mygroup/myuser/conda-envs (you may have to create this folder if it does not exist).
    3434
    35 By default, the package cache directory is created in your home directory, which will take a large space as you use 'conda'. To change the package cache directory, edit ~/.condarc file and add
     35By default, the package cache directory is created in your home directory, which will take up a large space as you use 'conda'. To change the package cache directory, edit ~/.condarc file and add
    3636{{{
    3737pkgs_dirs:
     
    4444
    4545 {{{
    46 conda create -n my_root python
     46conda create -n MPI python
    4747}}}
    4848
    49 'my_root' is the name of the environment that you decide.
     49'MPI' is the name of the environment that you decide.
    5050
    51 Also, in general in conda environments, python should not be using PYTHONPATH. (For more information, see [https://conda.io/projects/conda/en/latest/user-guide/troubleshooting.html#conda-reports-that-a-package-is-installed-but-it-appears-not-to-be here].)
     51Also, in general, in conda environments, Python should not use PYTHONPATH. (For more information, see [https://conda.io/projects/conda/en/latest/user-guide/troubleshooting.html#conda-reports-that-a-package-is-installed-but-it-appears-not-to-be here].)
    5252
    53 In particular, if you encounter errors during python module import, then you should unset PYTHONPATH prior to activating your conda environment.
     53In particular, if you encounter errors during Python module import, then you should unset PYTHONPATH prior to activating your conda environment.
    5454
    5555Hence,
    5656
    5757 {{{
    58 source activate my_root
     58source activate MPI
    5959}}}
    6060(When you get an error "!CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'", see [https://stackoverflow.com/questions/61915607/commandnotfounderror-your-shell-has-not-been-properly-configured-to-use-conda here])
     
    6363
    6464 {{{
    65 conda install vtk
     65conda install mpi4py
    6666}}}
    6767
     
    7171conda remove conda-build
    7272conda remove conda-env
    73 conda install vtk
     73conda install mpi4py
    7474}}}
    7575
    76 Next time, to use Anaconda python with your environment,
     76Next time, to use Anaconda Python with your environment,
    7777 {{{
    7878idev --partition=centos7
    7979module load anaconda3/2023.07
    8080export CONDA_ENVS_PATH=/lustre/project/mygroup/myuser/conda-envs
    81 source activate my_root
     81source activate MPI
    8282}}}
    83 You have to state the above commands in your script when you run python on batch jobs.
     83You have to state the above commands in your script when you run Python on batch jobs.
    8484
    8585