Skip to content

Instantly share code, notes, and snippets.

@johndpope
Created September 10, 2017 00:01
Show Gist options
  • Save johndpope/39521d7a2aa9df1719d0b26476492727 to your computer and use it in GitHub Desktop.
Save johndpope/39521d7a2aa9df1719d0b26476492727 to your computer and use it in GitHub Desktop.
conda command
conda info
conda info --all
conda info --license
# list conda environment
conda info -e
# list all the package in the current environment
conda list
# create simple conda environment
conda create -n name python=2
# remove an environment
conda remove --name abc --all
# conda configuration file
vim ~/.condarc
# install configuration file
# add HXN in .condarc
conda install hxn_configuration
# install binstar
conda install binstar
binstar config --set url https://anaconda.nsls2.bnl.gov # internal connection
# install conda build
conda install conda-build
# build package, go to the conda-recipe folder, which has
# build.sh
# meta.yaml
conda build .
# binstar login, so everything will be uploaded to that account online
binstar login
# upload to binstar online
binstar upload /home/lili/mc/conda-bld/linux-64/pyxrf-.post-_npNonepy27.tar.bz2
# or we can set upload as default, so upload will be automatically
conda config --set binstar_upload yes
# install and update package
conda install -c lili pyxrf
conda update -c lili pyxrf
# install at /tmp/, form ram so faster
conda create -p /tmp/test-databroker databroker hxn_configuration python=2.7
# create conda environment for a given beamline
git clone https://github.com/NSLS-II/conda-prescriptions
cd conda-prescriptions/beamlines/HXN/analysis
conda build .
conda create -n analysis hxn_analysis
... to be continued
ls miniconda/conda-bld/linux-64/
# conda install databroker at srx
conda install srx_configuration
conda install databroker
# proxy setup for nsls2 internal computers
export http_proxy=http://proxy:8888
export https_proxy=http://proxy:8888
export no_proxy=cs.nsls2.local
or
export HTTP_PROXY="http://192.168.1.165:3128"
export HTTPS_PROXY="https://192.168.1.165:3128"
or
export HTTP_PROXY="http://192.168.1.140:3128"
export HTTPS_PROXY="https://192.168.1.140:3128"
auto-build-tagged recipes goes to anaconda.org/lightsource2 and anaconda.nsls2.bnl.gov/nsls2-tag
staged-recipes-dev goes to anaconda.org/lightsource2-dev and anaconda.nsls2.bnl.gov/nsls2-dev
# for internal install
conda install package -c nsls2-dev -c nsls2-tag (-dev depends on -tag)
conda install package -c nsls2-tag
conda install package -c nsls2-tag --no-deps
# for outside
conda install package -c lightsource2 (==nsls2-tag)
conda install package -c lightsource2 -c lightsource2-dev (==nsls2-dev)
# package at nslsII: move to conda-forge later
# based on circleci
# conda forge
conda install -c conda-forge cycler
# enaml py3 build
# get build auto-build-tagged-recipes package
conda build auto-build-tagged-recipes/enaml-stack/kiwisolver-0.1.3.post21/ --python=3.4
conda build auto-build-tagged-recipes/enaml-stack/atom-py3compat/ --python=3.4
conda build auto-build-tagged-recipes/enaml-stack/enaml-py3compat/ --python=3.4
# conda build environment based on a file
conda env create -n mytest -f collection-env.yml
# output to a file
conda env export -n py27 -f abc.txt
# others
conda install 'conda<4.1' --override-channels -c defaults
git clone https://github.com/conda-forge/xraylib-feedstock.git
conda build xraylib-feedstock/recipe/ --python=3.5
############# anaconda cloud #############
# anaconda cloud upload
anaconda upload packagename -u nsls2-tag
# copy from other channel into my channel
anaconda copy scikit-xray/xraylib/3.1.0/osx-64/xraylib-3.1.0-nppy27_0.tar.bz2
# check online files from anaconda
anaconda show licode/pyxrf
anaconda remove licode/pyxrf/name
# use either internal web or public one
anaconda config --set url https://anaconda.nsls2.bnl.gov/api (the url address might be changed)
anaconda config --set url https://api.anaconda.org
# the default path for config file is at /etc/xdg/binstare/config.yaml
# the config file at user account is at ~/.config/binstar/config.yaml
# so if the one at user account is removed, anaconda will use system default one
# show config
anaconda config --show
anaconda config --file
# pip
pip install -v -e . # develop install
# source distributions to create hxnfly-0.0.2.tar.gz
python setup.py sdist
# checklist on beamline installation 16Q4
https://gist.github.com/tacaswell/4184f85f7424c891e60b683d16cf6a10
# used at beamline to change premission of conda
conda install -n root conda==4.0.8 anaconda-client conda-env=2.4.5
find /opt/conda -type d -execdir chmod og+x {} +
chmod -R a+r /opt/conda
V=17Q1.0
/opt/conda/bin/conda create -p /opt/conda_envs/collection-$V collection=$V $*
find /opt/conda_envs/collection-$V -type d -execdir chmod og+x {} +
chmod -R a+r /opt/conda_envs/collection-$V
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment