2

I have Anaconda2 installed on a remote machine where there is no internet connection.

I am trying to create a conda environment where I would run my application,when I tried :

    conda create -n nameofmyenv anaconda

but since it fetches packages from api.anaconda.com, it is not working and hangs at "Fetching packages" (no internet connection), so I set offline=True in a .condarc file (under anaconda2 directory), but no luck either (Error: package missing in current linux-64 channels)

I then tried :

    conda create --name nameofmyenv --clone root 

with both offline=True/False, it does create a folder nameofmyenv under anaconda2/envs but there is only one file in it which is the .condarc one. In the terminal and with this cmd, I got a KeyError for the package "sockjs-tornado-1.0.1-py27_0.tar.bz2" like so :

Image

even though this package exists in the anaconda2/pkgs folder.

I have already seen this script, but I'm not sure what to do with it exactly ? I created a file c2r.py in the anaconda2 folder and tried to run this script but I think I'm missing something..

Has anyone already tried to create a conda environment offline? If so how did you do it? ^^

Thank you :)

mfitzp
  • 15,275
  • 7
  • 50
  • 70
Samiella
  • 89
  • 2
  • 7
  • Possible duplicate of [How can I install a conda environment when offline?](https://stackoverflow.com/questions/31729731/how-can-i-install-a-conda-environment-when-offline) – Simba Sep 28 '19 at 14:41

2 Answers2

0

Installing conda packages offline

To install conda packages offline, run: conda install /path-to-package/package-filename.tar.bz2/

If you prefer, you can create a /tar/ archive file containing many conda packages and install them all with one command: conda install /packages-path/packages-filename.tar

b16sb
  • 1
-1

I found a way to get my code working without dependency issues, which is to clear the pythonpath variable, and then make it point to the python of Anaconda like so : export PYTHONPATH="~/anaconda2/bin/python".

This way I have no import problems on the remote machine with no internet connection (since I mainly use libraries already in anaconda)

Maybe this link can be helpful to others who want to create a conda environment offline using channels ;)

Community
  • 1
  • 1
Samiella
  • 89
  • 2
  • 7