1368
Comment: Initial setup and usage of python 3 environments
|
6591
general environment setup
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
== Setup Python 3 Environment == | = Under Construction = |
Line 3: | Line 3: |
=== Existing Miniconda/Anaconda Installations === 1. Create a new environment with python 3{{{ conda create -n eman-deps-15 eman-deps=15 -c cryoem/label/py3 -c cryoem -c defaults -c conda-forge |
== Setup Development Environment with Conda == 1. If you have an existing '''Miniconda2''' installation and want to make use of your cached packages, move your pkgs/ and envs/ folders out of your current installation to another location.{{{ mkdir -p <path-to-conda-cahe-directory> # mkdir -p ~/conda-global-cache mv <path-to-current-miniconda2-installation>/pkgs <path-to-conda-cahe-directory> mv <path-to-current-miniconda2-installation>/envs <path-to-conda-cahe-directory> |
Line 8: | Line 10: |
1. Use the activation command printed at the end of the previous command's run to activate the new conda environment {{{ conda activate eman-deps-15 or source activate eman-deps-15 |
1. Download Miniconda3 for [[https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh|Linux]] or [[https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh|MacOSX]]. 1. Install '''Miniconda3'''.{{{ bash <Miniconda3-installer> }}} and follow the prompts. 1. Specify package and environment directories.{{{ conda config --set pkgs_dirs <path-to-conda-cahe-directory>/pkgs # conda config --set pkgs_dirs ~/conda-global-cache/pkgs conda config --set envs_dirs <path-to-conda-cahe-directory>/envs # conda config --set pkgs_dirs ~/conda-global-cache/envs |
Line 13: | Line 20: |
1. To switch to another conda environment, first deactivate your current environment{{{ conda deactivate or source deactivate |
1. Configure conda. a. Do not update conda automatically.{{{ conda config --set auto_update_conda False }}} a. If you don't want conda's base environment to be activated automatically.{{{ conda config --set auto_activate_base False }}} 1. Install '''conda 4.6.14'''.{{{ conda install conda=4.6.14 -c defaults }}} 1. Initialize conda for shell interaction.{{{ conda init bash # See command help for supported shells conda init --help |
Line 19: | Line 36: |
== Use Conda Environments for Development == Do not install anything into the base environment, do not use the base environment for development, use non-base environments. 1. Create a new environment.{{{ conda create -n eman-deps-14.1 eman-deps=14.1 -c cryoem -c defaults -c conda-forge }}} OR choose a simpler name for the environment, '''eman-env''' or '''eman'''.{{{ conda create -n eman-env eman-deps=14.1 -c cryoem -c defaults -c conda-forge }}} 1. Activate the environment.{{{ conda activate eman-deps-14.1 }}} OR{{{ conda activate eman-env }}} == Setup Python 2 Environment With CMake 3.14 == [[https://github.com/cryoem/eman2/pull/407|PR: Upgrade CMake to 3.14]] |
|
Line 26: | Line 63: |
1. Update conda {{{ conda update conda -c defaults }}} 1. Install eman-deps with python 3{{{ conda install eman-deps=15 -c cryoem/label/py3 -c cryoem -c defaults -c conda-forge |
1. Install eman-deps with cmake 3.14.{{{ conda config --set auto_update_conda False conda install conda=4.6.14 conda install eman-deps=14.2 cmake=3.14 conda=4.6.14 -c cryoem/label/dev -c cryoem -c defaults -c conda-forge |
Line 34: | Line 70: |
=== Existing Miniconda/Anaconda Installations === 1. Pin your conda, you need to do this only once. Skip this step, if you have already done it.{{{ conda config --set auto_update_conda False conda install conda=4.6.14 }}} 1. Create a new environment.{{{ conda create -n eman-deps-14.2 eman-deps=14.2 cmake=3.14 -c cryoem/label/dev -c cryoem -c defaults -c conda-forge }}} 1. Use the activation command printed at the end of the previous command's run to activate the new conda environment.{{{ conda activate eman-deps-14.2 or source activate eman-deps-14.2 }}} 1. To switch to another conda environment, first deactivate your current environment.{{{ conda deactivate or source deactivate }}} == Setup Python 2 Environment with Boost 1.64 == [[https://github.com/cryoem/eman2/pull/408|PR: Upgrade Boost to 1.64]] === New Miniconda Installations === 1. Download and install [[https://repo.continuum.io/miniconda/|Miniconda]]. 1. Add the new installation to PATH.{{{ export PATH=<new miniconda path>/bin:$PATH }}} 1. Install eman-deps with cmake 3.14.{{{ conda config --set auto_update_conda False conda install conda=4.6.14 conda install eman-deps=14.3 cmake=3.14 boost=1.64 conda=4.6.14 -c cryoem/label/boost -c cryoem -c defaults -c conda-forge }}} === Existing Miniconda/Anaconda Installations === 1. Pin your conda, you need to do this only once. Skip this step, if you have already done it.{{{ conda config --set auto_update_conda False conda install conda=4.6.14 }}} 1. Create a new environment.{{{ conda create -n eman-deps-14.2 eman-deps=14.3 cmake=3.14 boost=1.64 -c cryoem/label/boost -c cryoem -c defaults -c conda-forge }}} 1. Use the activation command printed at the end of the previous command's run to activate the new conda environment.{{{ conda activate eman-deps-14.3 or source activate eman-deps-14.3 }}} 1. To switch to another conda environment, first deactivate your current environment.{{{ conda deactivate or source deactivate }}} == Setup Python 2 Environment with Boost 1.66 == [[https://github.com/cryoem/eman2/pull/410|PR: Build with Boost versions 1.65-1.66]] === New Miniconda Installations === 1. Download and install [[https://repo.continuum.io/miniconda/|Miniconda]]. 1. Add the new installation to PATH.{{{ export PATH=<new miniconda path>/bin:$PATH }}} 1. Install eman-deps with cmake 3.14.{{{ conda config --set auto_update_conda False conda install conda=4.6.14 conda install eman-deps=14.3 cmake=3.14 boost=1.66 conda=4.6.14 -c cryoem/label/boost -c cryoem -c defaults -c conda-forge }}} === Existing Miniconda/Anaconda Installations === 1. Pin your conda, you need to do this only once. Skip this step, if you have already done it.{{{ conda config --set auto_update_conda False conda install conda=4.6.14 }}} 1. Create a new environment.{{{ conda create -n eman-deps-14.2 eman-deps=14.3 cmake=3.14 boost=1.66 -c cryoem/label/boost -c cryoem -c defaults -c conda-forge }}} 1. Use the activation command printed at the end of the previous command's run to activate the new conda environment.{{{ conda activate eman-deps-14.3 or source activate eman-deps-14.3 }}} 1. To switch to another conda environment, first deactivate your current environment.{{{ conda deactivate or source deactivate }}} |
|
Line 35: | Line 175: |
1. Activate the python 3 environment, if it is a conda environment{{{ conda activate eman-deps-15 |
Checkout a branch and build as usual. 1. Update eman2 source.{{{ cd <source directory> git checkout <branch> git pull --rebase }}} 1. Activate conda environment, if it is a conda environment.{{{ conda activate <env-name> |
Line 38: | Line 184: |
source activate eman-deps-15 }}} or edit PATH to have the miniconda installation with python 3 as the first entry. 1. Move into your build directory {{{ cd <python 3 build directory> |
source activate <env-name> }}} or edit PATH to have the miniconda installation as the first entry. 1. Move into your build directory.{{{ cd <build directory> |
Line 43: | Line 189: |
1. Build and install {{{ | 1. Build and install.{{{ |
Under Construction
Setup Development Environment with Conda
If you have an existing Miniconda2 installation and want to make use of your cached packages, move your pkgs/ and envs/ folders out of your current installation to another location.
mkdir -p <path-to-conda-cahe-directory> # mkdir -p ~/conda-global-cache mv <path-to-current-miniconda2-installation>/pkgs <path-to-conda-cahe-directory> mv <path-to-current-miniconda2-installation>/envs <path-to-conda-cahe-directory>
Install Miniconda3.
bash <Miniconda3-installer>
and follow the prompts.Specify package and environment directories.
conda config --set pkgs_dirs <path-to-conda-cahe-directory>/pkgs # conda config --set pkgs_dirs ~/conda-global-cache/pkgs conda config --set envs_dirs <path-to-conda-cahe-directory>/envs # conda config --set pkgs_dirs ~/conda-global-cache/envs
- Configure conda.
Do not update conda automatically.
conda config --set auto_update_conda False
If you don't want conda's base environment to be activated automatically.
conda config --set auto_activate_base False
Install conda 4.6.14.
conda install conda=4.6.14 -c defaults
Initialize conda for shell interaction.
conda init bash # See command help for supported shells conda init --help
Use Conda Environments for Development
Do not install anything into the base environment, do not use the base environment for development, use non-base environments.
Create a new environment.
conda create -n eman-deps-14.1 eman-deps=14.1 -c cryoem -c defaults -c conda-forge
OR choose a simpler name for the environment, eman-env or eman.
conda create -n eman-env eman-deps=14.1 -c cryoem -c defaults -c conda-forge
Activate the environment.
conda activate eman-deps-14.1
OR
conda activate eman-env
Setup Python 2 Environment With CMake 3.14
New Miniconda Installations
Download and install Miniconda.
Add the new installation to PATH.
export PATH=<new miniconda path>/bin:$PATH
Install eman-deps with cmake 3.14.
conda config --set auto_update_conda False conda install conda=4.6.14 conda install eman-deps=14.2 cmake=3.14 conda=4.6.14 -c cryoem/label/dev -c cryoem -c defaults -c conda-forge
Existing Miniconda/Anaconda Installations
Pin your conda, you need to do this only once. Skip this step, if you have already done it.
conda config --set auto_update_conda False conda install conda=4.6.14
Create a new environment.
conda create -n eman-deps-14.2 eman-deps=14.2 cmake=3.14 -c cryoem/label/dev -c cryoem -c defaults -c conda-forge
Use the activation command printed at the end of the previous command's run to activate the new conda environment.
conda activate eman-deps-14.2 or source activate eman-deps-14.2
To switch to another conda environment, first deactivate your current environment.
conda deactivate or source deactivate
Setup Python 2 Environment with Boost 1.64
New Miniconda Installations
Download and install Miniconda.
Add the new installation to PATH.
export PATH=<new miniconda path>/bin:$PATH
Install eman-deps with cmake 3.14.
conda config --set auto_update_conda False conda install conda=4.6.14 conda install eman-deps=14.3 cmake=3.14 boost=1.64 conda=4.6.14 -c cryoem/label/boost -c cryoem -c defaults -c conda-forge
Existing Miniconda/Anaconda Installations
Pin your conda, you need to do this only once. Skip this step, if you have already done it.
conda config --set auto_update_conda False conda install conda=4.6.14
Create a new environment.
conda create -n eman-deps-14.2 eman-deps=14.3 cmake=3.14 boost=1.64 -c cryoem/label/boost -c cryoem -c defaults -c conda-forge
Use the activation command printed at the end of the previous command's run to activate the new conda environment.
conda activate eman-deps-14.3 or source activate eman-deps-14.3
To switch to another conda environment, first deactivate your current environment.
conda deactivate or source deactivate
Setup Python 2 Environment with Boost 1.66
PR: Build with Boost versions 1.65-1.66
New Miniconda Installations
Download and install Miniconda.
Add the new installation to PATH.
export PATH=<new miniconda path>/bin:$PATH
Install eman-deps with cmake 3.14.
conda config --set auto_update_conda False conda install conda=4.6.14 conda install eman-deps=14.3 cmake=3.14 boost=1.66 conda=4.6.14 -c cryoem/label/boost -c cryoem -c defaults -c conda-forge
Existing Miniconda/Anaconda Installations
Pin your conda, you need to do this only once. Skip this step, if you have already done it.
conda config --set auto_update_conda False conda install conda=4.6.14
Create a new environment.
conda create -n eman-deps-14.2 eman-deps=14.3 cmake=3.14 boost=1.66 -c cryoem/label/boost -c cryoem -c defaults -c conda-forge
Use the activation command printed at the end of the previous command's run to activate the new conda environment.
conda activate eman-deps-14.3 or source activate eman-deps-14.3
To switch to another conda environment, first deactivate your current environment.
conda deactivate or source deactivate
Build
Checkout a branch and build as usual.
Update eman2 source.
cd <source directory> git checkout <branch> git pull --rebase
Activate conda environment, if it is a conda environment.
conda activate <env-name> or source activate <env-name>
or edit PATH to have the miniconda installation as the first entry.Move into your build directory.
cd <build directory>
Build and install.
cmake <eman2 source directory> make make install