Skip to content

dev04 conda env setup

Tom Purucker edited this page Nov 29, 2018 · 1 revision

conda setup

This page is designed to give some basics on managing the python environment with conda. Installation details can be found at anaconda on the dev setup page.

Install locations

  • default install location on windows @ C:\Users\lan___id\AppData\Local\Continuum\Anaconda3 (hidden on epa machines)
  • default install location on mac @ ~/anaconda/bin/python

conda management

general conda info and configuration

# epa win10 should use anaconda prompt, not bash, for pycharm compatibility
conda --version
conda info
conda info --envs
conda list
python -V
# conda channels are controlled in the .condarc file

create conda environment for python

# epa win10 should use anaconda prompt, not bash, for pycharm compatibility
# anaconda prompt is windows prompt with stuff prepended to path
conda info --envs
conda update -n base conda # update conda itself
conda update -n root conda # update conda itself on win10
conda update python #update subversion
conda create -n py37 python=3.7 anaconda
conda activate py37
pip install --upgrade pip # for when using the shell script

install all qed dependencies into conda env

# windows machines must have c++ build tools installed, macs xcode, linux dev tools:
# http://landinghub.visualstudio.com/visual-cpp-build-tools
# with py36 activated
# navigate to a requirements_qed directory in qed_*, 
# then run our bash script that conda or pip installs all our dependencies
# linux/mac
bash ./install_conda_packages.sh
# windows from virtual env on anaconda prompt, may need to have git-scm installed
# Need to install unix extension for command prompt when installing git-scm in order
# to run bash script 
install_conda_packages.sh 
# check to see if gdal was installed ok
gdalinfo --version

install gdal and gdal dependencies (fiona) to env if they fail on epa windows

# download relevant wheel files from https://www.lfd.uci.edu/~gohlke/pythonlibs/
# to wherever you want to pip install them from, currently: 
# https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal
pip install GDAL-2.2.3-cp36-cp36m-win_amd64.whl
# https://www.lfd.uci.edu/~gohlke/pythonlibs/#fiona
pip install Fiona‑1.7.11.post1‑cp36‑cp36m‑win_amd64.whl