To further extend the versatility and utility of Python packages, multiple Python environments can coexist on a single workstation, independent of one another. You can also access conda from a command prompt. ArcGIS Pro integrates conda with the Package Manager page. To support Python packages, ArcGIS Pro includes a package management system named conda. Network access for creating environments andĪrcGIS Pro provides access to a large collection of Python packages.For example: conda create myenv -prefix=/work//. You can use the -prefix flag when building your environment. You can build Conda environments in different locations to save space on your home directory (see Storage Accessible on Discovery). Make sure to clean the Conda cache and clean unused packages with: conda clean -all.Ĭlean unused Conda environments by first listing the environments with: conda env list, and then removing unused ones: conda env remove -name. conda directory may get very large if you install multiple packages and create many virtual Conda environments. You can type this command again to deactivate the Miniconda environment. To deactivate the environment, type conda deactivate. Type conda activate my-python38environment to activate the environment. Type y if asked to proceed with the installation. In the example below, the Conda envinronment is named “my-python38environment” and installs Python version 3.8.Īfter completing steps 1 through 6 in the previous procedure, type conda create -name my-python38environment python=3.8. Type source /bin/activate to activate the miniconda environment.Īnother recommended step is to update your Conda version (possible only when using conda you own): conda update conda -yĪfter installing, activating and updating Miniconda, you can create a new virtual Conda environment. For example, set it to /work///miniconda3 (recommended). Type bash Miniconda3-latest-Linux-x86_64.sh -b -p to start the installation, where should be replaced with the full path to your desired installation directory. Type sha256sum Miniconda3-latest-Linux-x86_64.sh to check the hash key of the package. Type wget -quiet to get the latest version of Miniconda. If you are on a login node, move to a compute node by typing srun -partition=short -nodes=1 -cpus-per-task=1 -pty /bin/bash. This procedure uses the Miniconda3 version with Python version 3.8 in step 2, although there are other versions you can install, such as If you need to update Miniconda, don’t use the installation procedure. This procedure assumes that you have not installed Miniconda previously. To delete a Conda environment and all of its related packages, type conda remove -n -all. To deactivate the current, active Conda environment, type conda deactivate. To install a specific package, type conda install -n. Note that conda activate will not work on Discovery with this version. To activate your Conda environment, type source activate. To save space, also use the -prefix=/work// flag to build in your work directory.įollow the prompts to complete the Conda install. Tip: to see a list of all of your conda environments, type conda info -e. To create your environment, type conda create -n python=3.7 anaconda, where is the name you want to give your environment. To load anaconda, type module load anaconda3/2022.01. To check what version of Python you have installed, type which python. In the above example, we request for 1 node with 1 cpu core, but you can request for additional resources as per your requirements. This procedure uses the Anaconda module already loaded on Discovery. You can also have more than one environment with different packages for testing purposes. Using a locally installed Conda virtual environment is highly recommended so that you can install the specific packages that you need. Creating a Conda virtual environment with Anaconda # Anaconda is also a package manager that has a much larger number of packages that you can install.Ī question that frequently comes up is “Should I use Anaconda or Miniconda?” The Conda documentation site has a topic that can help you to decide which package manager to use. Miniconda is a free installer for Conda, Python,Īnd a few other useful packages. Conda is an open source environment and package manager.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |