Python Forum
Clone full Anaconda system to a PC without internet connection.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Clone full Anaconda system to a PC without internet connection.
#1
I am starting to work with python and I have to clone the "Anaconda + Spyder" environment that was installed some time ago on a Windwos PC with an internet connection to another Windows PC that does not have an internet connection and does not have anaconda or spyder installed.

I have been looking for information on the internet and have seen several ways to do this, but I do not know if they will work in my case:

1) Use Anaconda Enterprise, which is a commercial product, which allows create or replicate full Anaconda enviroment on PCs withouth internet access.

In my case I only have to replicate the installation of Anaconda (with all its libraries) in a single PC and I do not have nor will I have this commercial tool, so I discard this solution.

2) I could copy the full "Anaconda + Spyder" directories form the first PC to an USB pen and then copy again from this pen to the second PC.

However, I am sure that this will not work because in the second PC there are no paths to the installation of Anaconda or to the libraries installed later.

Also, it is very likely that I do not copy everything and there are things left without copying.

3) It is possible to export the Anaconda environment using:
- On the 1st PC: conda env export > environment.yml
- On the 2nd PC: conda env create -f environment.yml
But I am sure that this will not work either because Anaconda is not installed in the second PC.

4) Another alternative:
- On the 1st PC: conda create -n yourname python=x.x anaconda
- On the 2nd PC: source activate yourenvname
I think that this will not work either because there is nothing installed on the second PC (only a clean Windows installation).

I would appreciate help with this.
Reply
#2
Not Anaconda user here, but regarding 3):
Why not download Anaconda distribution while on PC with Internet connection (old PC or any other one) on USB drive and then install it on the new PC. Then you can use export of environment as described.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
Thanks, I have installed the "Anaconda distribution" on PC2 and then, on PC1 (Windows) open an "command promt" and type:

cd C:\Program Files\Anaconda3 (We go to the installation directory)

conda env export > "C:\Users\user_name\My Documents\environment.yml"

Then I get this error message:

Error: Unable to determine environment
Please re-run this command with one of the following options:
* Provide an environment name via --name or -n
* Re-run this command inside an activated conda environment.

In case it is helpful, I reproduce the output obtained when executing the command: conda info

Current conda install:
platform: win-32
Conda version: 4.1.6
Conda-env version: 2.5.1
Conda-build version: 1.21.3
python version: 3.5.2.final.0
requests version: 2.10.0
root environment: C:\Program Files\Anaconda3 (read only)
default environment: C:\Program Files\Anaconda3
envs directories: C:\Users\user_name\.conda\envs
C:\Users\user_name\envs
C:\Program Files\Anaconda3\envs
package cache: C:\Users\user_name\.conda\envs\.pkgs
C:\Users\user_name\envs\.pkgs
C:\Program Files\Anaconda3\pkgs
channel URLs: https:/repo.continuum.io/pkgs/free/win-32/
https:/repo.continuum.io/pkgs/free/noarch/
https:/repo.continuum.io/pkgs/pro/win-32/
https:/repo.continuum.io/pkgs/pro/noarch/
config file: None
Offline mode: False
is foreign system: False

After analyzing the output of this command, I tried again to export the Anaconda environment as follows:
cd C:\Users\user_name\.conda\envs
conda env export > "C:\Users\user_name\My Documents\environment.yml"

Then I get this error message:
usage: conda-env-script.py [-h]
(attach,create,export,list,remove,upload,update)
conda-env-script.py: error: invalid choice: 'C:\\Program Files\Anaconda3' (choose from 'attach','create','export','list','remove','upload','update')
Reply
#4
I have been able to execute the "conda export" command successfully on the second PC, in the following way:
cd C:\Program Files\Anaconda3
conda env export -n user_name > C:\users\user_name\Documents\environment.yml

However, I am confused with the content of the file obtained, since I expected to obtain a file that allows me to clone the configuration of the first PC on the second PC, and yet, what I get is a text file with a size of 93 bytes and the following content:

name: user_name
prefix: C:\Users\user_name\.conda\envs\user_name

Also, in the first PC, where I have executed "conda export", the next directory does not exist:
C:\Users\user_name\.conda\
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Best Python course (internet or better software) for a unknowing. If possible German. Tobias_Claren 3 1,351 Dec-29-2022, 07:42 AM
Last Post: Gribouillis
  Package Update without Internet Access on Host pythonator 3 2,668 Mar-27-2019, 06:20 PM
Last Post: pythonator

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020