Python Tutorials - Herong's Tutorial Examples - v2.14, by Herong Yang
Share Conda Environment with Others
This section provides a tutorial example on how to share Conda environments with other users. 2 examples are provided: sharing personal environment in a group, and sharing system environment with everyone.
How To Share Conda Environments with Other Users? There are several ways to share a Conda environment with another user:
1. Open your personal Conda environment for others to use. For example, here is how share my "graph" environment with Joe who is in the "it" group.
herong$ chgrp -R it /home/herong/anaconda3/envs/graph herong$ chmod -R 770 /home/herong/anaconda3/envs/graph herong$ ls -l /home/herong/anaconda3/envs drwxrwx---. 3 herong it 24 Jul 30 11:09 graph
Then ask Joe to add "/home/herong/anaconda3/envs/" to his Conda configuration file.
joe$ conda config --add envs_dirs /home/herong/anaconda3/envs joe$ conda info --env # conda environments: # ... graph /home/herong/anaconda3/envs/graph
2. Install Conda environments at the system level and share them with everyone on the system. By default, Conda uses "/usr/local/anaconda3" as the system home directory.
herong$ echo $PATH /usr/local/anaconda3/condabin:/home/herong/.local/bin:/home/herong/bin:... herong$ sudo /usr/local/anaconda3/condabin/conda create -n math ... ## Package Plan ## environment location: /usr/local/anaconda3/envs/math Proceed ([y]/n)? y herong$ conda info --env base * /usr/local/anaconda3 math /usr/local/anaconda3/envs/math herong$ ls -l /usr/local/anaconda3/envs drwxr-sr-x. 3 root root 24 Jul 13 20:44 math
Share it with all users. Note that "write" permission is needed, since some Python scripts create temporary files in the Conda environment directory.
herong$ sudo chmod -R 777 /usr/local/anaconda3/envs/math herong$ ls -l /usr/local/anaconda3/envs drwxrwxrwx. 3 root root 24 Jul 13 20:44 math
Then ask Joe to add "/usr/local/anaconda3/envs" to his Conda configuration file.
joe$ conda config --add envs_dirs //usr/local/anaconda3/envs joe$ conda info --env # conda environments: # ... graph /home/herong/anaconda3/envs/graph math /usr/local/anaconda3/envs/math
Table of Contents
Variables, Operations and Expressions
Function Statement and Function Call
Iterators, Generators and List Comprehensions
Packages and Package Directories
"pathlib" - Object-Oriented Filesystem Paths
"pip" - Package Installer for Python
SciPy.org - Python Libraries for Science
pandas - Data Analysis and Manipulation
►Anaconda - Python Environment Manager
Introduction to Conda Environment
►Share Conda Environment with Others
Manage Packages in Conda Environment
Run Conda Environment Command in Background