Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ResolvePackageNotFound:在mac OSX上使用conda和yml文件创建环境_Python_Pip_Anaconda_Yaml_Conda - Fatal编程技术网

Python ResolvePackageNotFound:在mac OSX上使用conda和yml文件创建环境

Python ResolvePackageNotFound:在mac OSX上使用conda和yml文件创建环境,python,pip,anaconda,yaml,conda,Python,Pip,Anaconda,Yaml,Conda,首先,我是个十足的新手,请忍受我的白痴:) 我运行以下命令: conda env create -f env.yml 这是yml文件: name: DAND channels: !!python/tuple - defaults dependencies: - _nb_ext_conf=0.3.0=py27_0 - anaconda-client=1.6.0=py27_0 - appnope=0.1.0=py27_0 - backports=1.0=py27_0 - backports_ab

首先,我是个十足的新手,请忍受我的白痴:)

我运行以下命令:

conda env create -f env.yml 
这是yml文件:

name: DAND
channels: !!python/tuple
- defaults
dependencies:
- _nb_ext_conf=0.3.0=py27_0
- anaconda-client=1.6.0=py27_0
- appnope=0.1.0=py27_0
- backports=1.0=py27_0
- backports_abc=0.5=py27_0
- beautifulsoup4=4.5.1=py27_0
- clyent=1.2.2=py27_0
- configparser=3.5.0=py27_0
- cycler=0.10.0=py27_0
- decorator=4.0.10=py27_1
- entrypoints=0.2.2=py27_0
- enum34=1.1.6=py27_0
- freetype=2.5.5=1
- functools32=3.2.3.2=py27_0
- get_terminal_size=1.0.0=py27_0
- icu=54.1=0
- ipykernel=4.5.2=py27_0
- ipython=5.1.0=py27_1
- ipython_genutils=0.1.0=py27_0
- ipywidgets=5.2.2=py27_0
- jinja2=2.8=py27_1
- jsonschema=2.5.1=py27_0
- jupyter=1.0.0=py27_3
- jupyter_client=4.4.0=py27_0
- jupyter_console=5.0.0=py27_0
- jupyter_core=4.2.1=py27_0
- libpng=1.6.22=0
- markupsafe=0.23=py27_2
- matplotlib=1.5.3=np111py27_1
- mistune=0.7.3=py27_1
- mkl=11.3.3=0
- nb_anacondacloud=1.2.0=py27_0
- nb_conda=2.0.0=py27_0
- nb_conda_kernels=2.0.0=py27_0
- nbconvert=4.2.0=py27_0
- nbformat=4.2.0=py27_0
- nbpresent=3.0.2=py27_0
- nltk=3.2.1=py27_0
- notebook=4.3.0=py27_0
- numpy=1.11.2=py27_0
- openssl=1.0.2j=0
- pandas=0.19.1=np111py27_0
- path.py=8.2.1=py27_0
- pathlib2=2.1.0=py27_0
- pexpect=4.0.1=py27_0
- pickleshare=0.7.4=py27_0
- pip=9.0.1=py27_1
- prompt_toolkit=1.0.9=py27_0
- ptyprocess=0.5.1=py27_0
- pygments=2.1.3=py27_0
- pymongo=3.3.0=py27_0
- pyparsing=2.1.4=py27_0
- pyqt=5.6.0=py27_1
- python=2.7.12=1
- python-dateutil=2.6.0=py27_0
- python.app=1.2=py27_4
- pytz=2016.10=py27_0
- pyyaml=3.12=py27_0
- pyzmq=16.0.2=py27_0
- qt=5.6.2=0
- qtconsole=4.2.1=py27_1
- readline=6.2=2
- requests=2.12.3=py27_0
- scikit-learn=0.17.1=np111py27_2
- scipy=0.18.1=np111py27_0
- seaborn=0.7.1=py27_0
- setuptools=27.2.0=py27_0
- simplegeneric=0.8.1=py27_1
- singledispatch=3.4.0.3=py27_0
- sip=4.18=py27_0
- six=1.10.0=py27_0
- sqlite=3.13.0=0
- ssl_match_hostname=3.4.0.2=py27_1
- terminado=0.6=py27_0
- tk=8.5.18=0
- tornado=4.4.2=py27_0
- traitlets=4.3.1=py27_0
- unicodecsv=0.14.1=py27_0
- wcwidth=0.1.7=py27_0
- wheel=0.29.0=py27_0
- widgetsnbextension=1.2.6=py27_0
- xlrd=1.0.0=py27_0
- yaml=0.1.6=0
- zlib=1.2.8=3
- pip:
  - backports-abc==0.5
  - backports.shutil-get-terminal-size==1.0.0
  - backports.ssl-match-hostname==3.4.0.2
  - ipython-genutils==0.1.0
  - jupyter-client==4.4.0
  - jupyter-console==5.0.0
  - jupyter-core==4.2.1
  - nb-anacondacloud==1.2.0
  - nb-conda==2.0.0
  - nb-conda-kernels==2.0.0
  - prompt-toolkit==1.0.9
prefix: /Users/mat/anaconda/envs/DAND
我遇到的错误是:

Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound: 
  - jupyter_console==5.0.0=py27_0
  - freetype==2.5.5=1
  - pyzmq==16.0.2=py27_0
  - configparser==3.5.0=py27_0
  - scipy==0.18.1=np111py27_0
  - libpng==1.6.22=0
  - ...then the list goes on and list all of the dependencies in the yml file, except the ones under pip 
Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies.  Conda may not use the correct pip to install your packages, and they may end up in the wrong place.  Please add an explicit pip dependency.  I'm adding one for you, but still nagging you.
Collecting package metadata (repodata.json): done
Solving environment: done
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Ran pip subprocess with arguments:
['/Users/yulia/anaconda3/envs/DAND/bin/python', '-m', 'pip', 'install', '-U', '-r', '/Users/yulia/data analysis -uda/condaenv.mo_ctuap.requirements.txt']
Pip subprocess output:

Pip subprocess error:
ERROR: Double requirement given: backports_abc==0.5=py27_0 (from -r /Users/yulia/data analysis -uda/condaenv.mo_ctuap.requirements.txt (line 12)) (already in backports-abc==0.5 (from -r /Users/yulia/data analysis -uda/condaenv.mo_ctuap.requirements.txt (line 1)), name='backports-abc')

CondaEnvException: Pip failed
我尝试过的事情:
  • 我从Udacity在线课程中获得了这个yaml文件,我是从网站下载的,所以我认为conda env export--no builds>env.yml方法不适用于我

  • 我在中尝试了该解决方案,只是将所有内容移动到pip块下,然后遇到了新的错误。也许我误解了答案

  • 我遇到的新错误:

    Collecting package metadata (repodata.json): done
    Solving environment: failed
    
    ResolvePackageNotFound: 
      - jupyter_console==5.0.0=py27_0
      - freetype==2.5.5=1
      - pyzmq==16.0.2=py27_0
      - configparser==3.5.0=py27_0
      - scipy==0.18.1=np111py27_0
      - libpng==1.6.22=0
      - ...then the list goes on and list all of the dependencies in the yml file, except the ones under pip 
    
    Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies.  Conda may not use the correct pip to install your packages, and they may end up in the wrong place.  Please add an explicit pip dependency.  I'm adding one for you, but still nagging you.
    Collecting package metadata (repodata.json): done
    Solving environment: done
    Preparing transaction: done
    Verifying transaction: done
    Executing transaction: done
    Ran pip subprocess with arguments:
    ['/Users/yulia/anaconda3/envs/DAND/bin/python', '-m', 'pip', 'install', '-U', '-r', '/Users/yulia/data analysis -uda/condaenv.mo_ctuap.requirements.txt']
    Pip subprocess output:
    
    Pip subprocess error:
    ERROR: Double requirement given: backports_abc==0.5=py27_0 (from -r /Users/yulia/data analysis -uda/condaenv.mo_ctuap.requirements.txt (line 12)) (already in backports-abc==0.5 (from -r /Users/yulia/data analysis -uda/condaenv.mo_ctuap.requirements.txt (line 1)), name='backports-abc')
    
    CondaEnvException: Pip failed
    
    我阅读了其他一些建议使用pip安装requirements.txt文件的帖子,以及一些关于“CondaEnvException:pip失败”情况的帖子。但是他们没有写出明确的解决方案,大多数时候我真的对这些解决方案感到困惑


    请让我知道我在这里遗漏了什么,这让我感到沮丧,因为我无法设置合适的环境继续上课。提前非常感谢

    更新

    似乎当您跳过使用env文件时,最终情况可能会更好。相反,手动创建具有所需依赖项的env,这样库就可以更新,笔记本也可以正常工作

    $conda create-n DAND python=2 numpy pandas matplotlib seaborn
    
    在课程的“设置系统”(或类似)部分中查找所需的库。我的例子中的例子基于Udacity的“数据分析入门”课程


    老答案

    我有一个类似的问题,最终对我有效的是在这个YAML文件的通道部分添加了两个以上的通道

    之前:

    channels: !!python/tuple
      - defaults
    
    之后:

    channels: !!python/tuple
      - defaults
      - conda-forge
      - anaconda
    
    然后找到了所有具有版本限制的软件包


    如果您在冲突版本方面遇到一些错误,请确保将
    conda
    config
    channel\u priority
    设置为
    false

    $conda config--将通道优先级设置为false
    
    更新

    似乎当您跳过使用env文件时,最终情况可能会更好。相反,手动创建具有所需依赖项的env,这样库就可以更新,笔记本也可以正常工作

    $conda create-n DAND python=2 numpy pandas matplotlib seaborn
    
    在课程的“设置系统”(或类似)部分中查找所需的库。我的例子中的例子基于Udacity的“数据分析入门”课程


    老答案

    我有一个类似的问题,最终对我有效的是在这个YAML文件的通道部分添加了两个以上的通道

    之前:

    channels: !!python/tuple
      - defaults
    
    之后:

    channels: !!python/tuple
      - defaults
      - conda-forge
      - anaconda
    
    然后找到了所有具有版本限制的软件包


    如果您在冲突版本方面遇到一些错误,请确保将
    conda
    config
    channel\u priority
    设置为
    false

    $conda config--将通道优先级设置为false
    
    将所有依赖项移动到pip并重试我尝试过几次,我将所有内容移动到pip块,缩进了它,它一直给我相同的错误条件异常:pip失败您需要首先安装
    pip
    我想我已经安装了pip;(我还试图解决“CondaEnvException:Pip失败”的问题,错误消息表示给出了双重要求,因此我尝试删除一行,然后错误消息变成“找不到XXX的匹配分发”.我很确定整个文件在这一点上是无用的,我已经尝试删除了十几行,每次都出现相同的错误消息,“没有找到与XXX匹配的发行版”此
    env.yml
    文件指定了它要安装的每个软件包的确切版本,因此,如果配置的conda频道无法提供其中任何一个,那么我认为整个程序都将失败。可能您不需要精确地使用这些版本来完成课程。请尝试编辑除Py之外的所有软件包的版本说明符thon本身?例如,将
    jupyter_console==5.0.0=py27_0
    更改为just
    jupyter console
    ,等等。如果这样做有效,并且您担心版本差异,您可以重试,这次可以添加一些版本说明符。将所有依赖项移到pip并重试。我尝试了几次,每次都移动了pip块的东西,缩进它,它一直给我相同的错误CondaEnvException:pip失败你需要首先安装
    pip
    我想我确实安装了pip;(我还试图解决“CondaEnvException:pip失败”问题,错误消息说了一些关于给定的双重要求的信息,所以我尝试删除一行,然后错误消息变成“找不到XXX的匹配分发”。我很确定整个文件在这一点上是无用的,我尝试删除了十几行,每次都是相同的错误消息,“找不到XXX的匹配分发"此
    env.yml
    文件指定了它要安装的每个软件包的确切版本,因此,如果配置的conda频道无法提供其中任何一个,那么我认为整个程序都将失败。可能您不需要精确地使用这些版本来完成课程。请尝试编辑除Py之外的所有软件包的版本说明符thon本身?例如,将
    jupyter_console==5.0.0=py27_0
    更改为仅
    jupyter console
    ,等等。如果这样做有效,并且您担心版本差异,您可以重试,这次添加一些版本说明符。