- Install conda with Anaconda for Python Distribution. Conda is a python package manager that will install python 3.x and other packages listed in the environment.yml file.
- Choose the 3.x version
- Note: Make sure to check "Add to PATH environment variable"
- Restart your computer. Because you added conda to the PATH variable, you should be able to use the
conda
command in any terminal (Windows command prompt, Powershell, etc). Open a terminal and typeconda
to make sure the conda command is recognized. - In the terminal, navigate to the location of your code repository.
- Create a new environment with Conda (more info)
conda env create --name projectname
- Activate the environment:
conda activate projectname
- Install the ArcGIS API for Python into the new environment: (more info)
conda install -c esri arcgis -n projectname
- Export the YML file and save it to your SCM:
conda env export > environment.yml --name projectname
- Note, every time you install another package into the environment, you should re-export this
environment.yml
file and save to SCM.
- Note, every time you install another package into the environment, you should re-export this
Once you've done the above and saved the environment.yml
file to your SCM, to get the same environment going on a new computer:
- Run steps 1-3 from above.
- Create a new environment with Conda, and install all the packages listed in environment.yml:
conda env create --name projectname --file environment.yml
- Activate the environment:
conda activate projectname
- Make sure you select your new environment by opening the Command Palette (CTRL + P), choosing "Python: Select Interpreter" and choose your envioroment. Note that sometimes I have to close/open VS Code to get it to appear here.