How to specify version ranges in Conda environment.yml

I think/assume that the syntax specifying versions is the one documented at Package match specifications. So you would write – numpy >=1.2.3,<1.3 (space after numpy, no space after the comma – not tested). BTW, I couldn’t find any documentation describing the structure of the environment file environment.yml. creating-an-environment-from-an-environment-yml-file refers to Creating an environment file manually … Read more

run a crontab job using an anaconda env

I recently switched from canopy to Anaconda precisely to get away from having to activate an env in cron jobs. Anaconda makes this very simple, based on the PATH enviornment variable. (I’m using miniconda not the full Anaconds install but I believe anaconda should work the same way) There are two different approaches, I’ve tested; … Read more

How to install packages with miniconda in Dockerfile?

This will work using ARG and ENV: FROM ubuntu:18.04 ENV PATH=”/root/miniconda3/bin:${PATH}” ARG PATH=”/root/miniconda3/bin:${PATH}” RUN apt-get update RUN apt-get install -y wget && rm -rf /var/lib/apt/lists/* RUN wget \ https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \ && mkdir /root/.conda \ && bash Miniconda3-latest-Linux-x86_64.sh -b \ && rm -f Miniconda3-latest-Linux-x86_64.sh RUN conda –version

Specific reasons to favor pip vs. conda when installing Python packages

I find I use conda first simply because it installs the binary, than try pip if the package isn’t there. For instance psycopg2 is far easier to install in conda than pip. https://jakevdp.github.io/blog/2016/08/25/conda-myths-and-misconceptions/ Pip, which stands for Pip Installs Packages, is Python’s officially-sanctioned package manager, and is most commonly used to install packages published on … Read more

What is the purpose of the c flag in the “conda install” command

-c stands for –channel. It’s used to specify a channel where to search for your package, the channel is often named owner. The generic command is: conda install -c CHANNEL_NAME PACKAGE_NAME For example, let’s say you want to download pytorch. You can search on anaconda.org. You’ll see that pytorch (the pacakge) is owned by pytorch. … Read more

What is the difference between miniconda and miniforge?

miniforge is the community (conda-forge) driven minimalistic conda installer. Subsequent package installations come thus from conda-forge channel. miniconda is the Anaconda (company) driven minimalistic conda installer. Subsequent package installations come from the anaconda channels (default or otherwise). miniforge started a few months ago because miniconda doens’t support aarch64, very quickly the ‘PyPy’ people jumped on … Read more