Anaconda export Environment file

后端 未结 5 2056
后悔当初
后悔当初 2020-12-12 09:32

How can I make anaconda environment file which could be use on other computers?

I exported my anaconda python environment to YML using conda env export > en

5条回答
  •  感动是毒
    2020-12-12 09:52

    • Linux

      conda env export --no-builds | grep -v "prefix" > environment.yml

    • Windows

      conda env export --no-builds | findstr -v "prefix" > environment.yml


    Rationale: By default, conda env export includes the build information:

    $ conda env export
    ...
    dependencies:
      - backcall=0.1.0=py37_0
      - blas=1.0=mkl
      - boto=2.49.0=py_0
    ...
    

    You can instead export your environment without build info:

    $ conda env export --no-builds
    ...
    dependencies:
      - backcall=0.1.0
      - blas=1.0
      - boto=2.49.0
    ...
    

    Which unties the environment from the Python version and OS.

提交回复
热议问题