Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I recreate my conda environment using yml file?

My conda export was done like this: conda env export --file environment.yml -n djangoenv

The file itself looks like this:

name: djangoenv
channels:
- bioconda
- anaconda-cluster
- defaults
dependencies:
- anaconda-cluster::python-apt=0.8.5=py27_0
- auto::pyumpf=0.1.1=py27_0
- binstar::binstar=1.3.1=py27_0
- bioconda::httplib2=0.9.2=py27_0
- clyent=1.2.2=py27_0
- conda-forge::backports.shutil_get_terminal_size=1.0.0=py27_0
- conda-forge::ca-certificates=2016.2.28=0
- conda-forge::ipython=4.2.0=py27_0
- conda-forge::pexpect=4.1.0=py27_0
- conda-forge::pickleshare=0.7.2=py27_0
- conda-forge::ptyprocess=0.5.1=py27_0
- conda-forge::python-pathlib2=2.1.0=py27_0
- conda-forge::traitlets=4.2.1=py27_0
- dateutil=2.4.1=py27_0
- decorator=4.0.9=py27_0
- ecdsa=0.13=py27_0
- ipython_genutils=0.1.0=py27_0
- jinja2=2.8=py27_0
- kbroughton::ansible=2.0.0.2=py27_0
- markupsafe=0.23=py27_0
- openssl=1.0.2h=0
- paramiko=1.16.0=py27_0
- pip=8.1.1=py27_1
- psycopg2=2.6.1=py27_1
- pycrypto=2.6.1=py27_0
- python=2.7.11=0
- pytz=2016.4=py27_0
- pyyaml=3.11=py27_1
- readline=6.2=2
- requests=2.10.0=py27_0
- setuptools=20.7.0=py27_0
- simplegeneric=0.8.1=py27_0
- six=1.10.0=py27_0
- sqlite=3.9.2=0
- tk=8.5.18=0
- travis::ansible-shell=0.0.2=py27_0
- wheel=0.29.0=py27_0
- yaml=0.1.6=0
- zlib=1.2.8=0
- pip:
  - anaconda-client==1.3.1
  - ansible==2.0.0.2
  - ansible-lint==2.3.3
  - ansible-shell==0.0.2
  - backports.shutil-get-terminal-size==1.0.0
  - coverage==4.0.3
  - django==1.8
  - django-angular==0.7.15
  - django-countries==3.4.1
  - django-easy-pdf==0.1.0
  - django-money==0.7.4
  - django-nose==1.4.3
  - django-pagination==1.0.7
  - django-password-reset==0.8.2
  - django-tastypie==0.13.3
  - djangorestframework==3.4.0
  - easyprocess==0.2.2
  - funcsigs==1.0.2
  - html5lib==1.0b8
  - httplib2==0.9.2
  - idna==2.1
  - ipdb==0.9.3
  - ipython==4.1.2
  - ipython-genutils==0.1.0
  - mock==2.0.0
  - nose==1.3.7
  - pathlib2==2.1.0
  - pbr==1.10.0
  - pexpect==4.1.0
  - pickleshare==0.7.2
  - pillow==3.3.0
  - ptyprocess==0.5.1
  - py-moneyed==0.6.0
  - pyasn1==0.1.9
  - pycparser==2.14
  - pypdf2==1.26.0
  - python-apt==0.0.0
  - python-dateutil==2.4.1
  - python-ldap==2.4.26
  - python-mimeparse==1.5.2
  - pyum==0.1.1
  - pyumpf==0.1.1
  - pyvirtualdisplay==0.2
  - reportlab==3.3.0
  - selenium==2.53.5
  - splinter==0.7.3
  - traitlets==4.2.1
  - webencodings==0.5
  - xhtml2pdf==0.1b1

When I try to recreate my environment using the environment.yml file, I get the following error:

~/P/c/ansible-deployment ❯❯❯ conda env create --file=environment.yml -n djangoenv2                                                          master ✭ ◼
Using Anaconda Cloud api site https://api.anaconda.org
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata ...........
Solving package specifications: .
Error: Packages missing in current linux-64 channels: 
  - anaconda-cluster::python-apt 0.8.5 py27_0
  - auto::pyumpf 0.1.1 py27_0
  - binstar::binstar 1.3.1 py27_0
  - bioconda::httplib2 0.9.2 py27_0
  - conda-forge::backports.shutil_get_terminal_size 1.0.0 py27_0
  - conda-forge::ca-certificates 2016.2.28 0
  - conda-forge::ipython 4.2.0 py27_0
  - conda-forge::pexpect 4.1.0 py27_0
  - conda-forge::pickleshare 0.7.2 py27_0
  - conda-forge::ptyprocess 0.5.1 py27_0
  - conda-forge::python-pathlib2 2.1.0 py27_0
  - conda-forge::traitlets 4.2.1 py27_0
  - kbroughton::ansible 2.0.0.2 py27_0
  - travis::ansible-shell 0.0.2 py27_0

How can I get this to work ?

like image 322
Muhammad Lukman Low Avatar asked Nov 27 '22 03:11

Muhammad Lukman Low


1 Answers

conda env update --prefix ./env --file environment.yml --prune

ref: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#updating-an-environment

To update a specific environment if you aren't just using the default, add --name [env name] to the above command.

like image 131
biased Avatar answered Nov 29 '22 13:11

biased