5

我的 conda 导出是这样完成的:conda env export --file environment.yml -n djangoenv

文件本身如下所示:

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

当我尝试使用该environment.yml文件重新创建我的环境时,我收到以下错误:

~/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

我怎样才能让它工作?

4

2 回答 2

2

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

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

如果您不只是使用默认环境,要更新特定环境,请添加--name [env name]到上述命令。

于 2021-02-02T12:54:33.437 回答
-3

你可以试试这个命令:conda env create -f environment.yml

于 2018-06-22T17:24:00.203 回答