we want to create a conda environment using packages from arbitrary channels in a machine with no internet access (let's say that we want a machine with keras, sklearn and all taurus dependencies installed)
It is better to use a clean conda installation, so we will use a miniconda docker container
docker run -it --name tmpconda continuumio/miniconda3
conda config --add channels conda-forge
conda config --add channels tango-controls
conda create -n keras -y \
pip \
python=3 \
pyqt=5 \
itango \
pytango \
lxml \
future \
guidata \
guiqwt \
ipython \
pillow \
pint \
ply \
pyqtgraph \
pythonqwt \
numpy \
scipy \
keras \
matplotlib \
scikit-learn
# create a tarball with all cached packages (the pkgs dir can be found with `conda info`):
cd /opt/conda/pkgs
tar -cf /pkgs.tar *.bz2
# transfer the packages to the offline machine
docker cp tmpconda:/pkgs.tar .
scp pkgs.tar <offlinemachine>:
# create a directory for a local conda channel
mkdir -p $HOME/.conda/offline_channel/noarch
# put the the bz2 package files into the created dir
tar -C $HOME/.conda/offline_channel/noarch -xf pkgs.tar
# create an index for the channel
conda index $HOME/.conda/offline_channel/
# add the channel to the default conda ones (you can check that it worked with "conda info")
conda config --add channels file://$HOME/.conda/offline_channel/
# install or create env with --offline
conda create --offline -n keras \
pip \
python=3 \
pyqt=5 \
itango \
pytango \
lxml \
future \
guidata \
guiqwt \
ipython \
pillow \
pint \
ply \
pyqtgraph \
pythonqwt \
numpy \
scipy \
keras \
matplotlib \
scikit-learn