How to transfer Anaconda env installed on one machine to another? [Both with Ubuntu installed]

前端 未结 4 1159
青春惊慌失措
青春惊慌失措 2021-02-05 18:52

I have been using Anaconda(4.3.23) on my GuestOS ubuntu 14.04 which is installed on Vmware on HostOS windows 8.1. I have setup an environm

4条回答
  •  一个人的身影
    2021-02-05 19:43


    If conda list --export failes like this ...

    Executing conda list --export > package-list.txt creates a file which looks like this:

    # This file may be used to create an environment using:
    # $ conda create --name  --file 
    # platform: win-64
    _tflow_1100_select=0.0.1=gpu
    absl-py=0.5.0=py_0
    astor=0.7.1=py_0
    ...
    

    But creating a new environment by executing conda create -n myenv --file package-list.txt gives me this error:

    Solving environment: ...working... failed
    
    PackagesNotFoundError: The following packages are not available from current channels:
    
      - markdown==2.6.11=py_0
      ...
    

    ... then try to use conda env export

    According to this discussion execute the following command on your source machine:

    source activate yourEnvironment
    conda env export --no-builds > file.txt
    

    On the target machine execute:

    conda env create --file /path/to/file.txt
    

    The file generated by conda env export looks a bit different, but it contains pip packages as well:

    name: yourEnvironment
    channels:
      - conda-forge
      - defaults
    dependencies:
      - absl-py=0.5.0
      ...
      - pip:
        - astroid==2.0.4
        ...
    

提交回复
热议问题