Changes between Version 15 and Version 16 of cypress/AnacondaInstallPackage
- Timestamp:
- 10/15/25 12:46:03 (9 hours ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
cypress/AnacondaInstallPackage
v15 v16 8 8 }}} 9 9 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. 11 There is a workaround. Here, for example, we want to add 'mpi4py' Python wrapper library for MPI. You try: 12 12 13 13 {{{ 14 conda install vtk14 conda install mpi4py 15 15 }}} 16 16 17 But you will see an error message due to your lack of write permission to the shared directory such as the following.17 But you will see an error message due to your lack of write permission to the shared directory, such as the following. 18 18 19 19 … … 25 25 }}} 26 26 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_PATHenvironment variable will tell Anaconda where to place and look for your conda environments. For example: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 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: 28 28 29 29 {{{ … … 31 31 }}} 32 32 33 will put your conda environments atthe folder /lustre/project/mygroup/myuser/conda-envs (you may have to create this folder if it does not exist).33 will 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). 34 34 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 add35 By 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 36 36 {{{ 37 37 pkgs_dirs: … … 44 44 45 45 {{{ 46 conda create -n my_rootpython46 conda create -n MPI python 47 47 }}} 48 48 49 ' my_root' is the name of the environment that you decide.49 'MPI' is the name of the environment that you decide. 50 50 51 Also, in general in conda environments, python should not be usingPYTHONPATH. (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].)51 Also, 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].) 52 52 53 In particular, if you encounter errors during python module import, then you should unset PYTHONPATH prior to activating your conda environment.53 In particular, if you encounter errors during Python module import, then you should unset PYTHONPATH prior to activating your conda environment. 54 54 55 55 Hence, 56 56 57 57 {{{ 58 source activate my_root58 source activate MPI 59 59 }}} 60 60 (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]) … … 63 63 64 64 {{{ 65 conda install vtk65 conda install mpi4py 66 66 }}} 67 67 … … 71 71 conda remove conda-build 72 72 conda remove conda-env 73 conda install vtk73 conda install mpi4py 74 74 }}} 75 75 76 Next time, to use Anaconda python with your environment,76 Next time, to use Anaconda Python with your environment, 77 77 {{{ 78 78 idev --partition=centos7 79 79 module load anaconda3/2023.07 80 80 export CONDA_ENVS_PATH=/lustre/project/mygroup/myuser/conda-envs 81 source activate my_root81 source activate MPI 82 82 }}} 83 You have to state the above commands in your script when you run python on batch jobs.83 You have to state the above commands in your script when you run Python on batch jobs. 84 84 85 85