conda returns 'Solving environment: failed'

怎甘沉沦 提交于 2019-12-03 06:03:31

Downgrading to conda 4.5.5 fixed this for me.

And with a ranting hat on: This is the third time in the space of about 18 months that a conda update has resulted in an error that causes builds to fail, and there's been plenty of other issues too. I presume it will be fixed by the core conda people at some point, and maybe it is caused by a particular combination of third party dependencies, but one way or another conda always seems extremely buggy. There was once an update that caused conda install conda to delete itself!

thank you, that works ! in case the link grows old, here is the simplified copy:

  1. Navigate to your conda base environment, as given by conda info.
  2. Open the file lib/pythonX.Y/site-packages/conda/gateways/connection/init.py. Where X.Y is the python major-minor version.
  3. Replace the function 'should_bypass_proxies_patched' with :

    def should_bypass_proxies_patched(should_bypass_proxies_func, url, no_proxy=None):
        if url.startswith("file://"):
            return True
        try:
            return should_bypass_proxies_func(url, no_proxy)
        except TypeError:
            return should_bypass_proxies_func(url)
    

This problem is still out in the field - started happening to me on a fresh Windows 10 install with latest stable Anaconda (2018.12). Getting 'Solving environment: failed' on 'conda install -c conda-forge xgboost' command. I could install something from the base channel eg. 'conda install numpy'

(base) C:\Windows\system32>conda info

     active environment : base
    active env location : C:\ProgramData\Anaconda3
            shell level : 1
       user config file : C:\Users\maglk\.condarc
 populated config files : C:\Users\maglk\.condarc
          conda version : 4.5.12
    conda-build version : 3.17.6
         python version : 3.7.1.final.0
       base environment : C:\ProgramData\Anaconda3  (writable)
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/win-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/win-64
                          https://repo.anaconda.com/pkgs/pro/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\ProgramData\Anaconda3\pkgs
                          C:\Users\maglk\AppData\Local\conda\conda\pkgs
       envs directories : C:\ProgramData\Anaconda3\envs
                          C:\Users\maglk\AppData\Local\conda\conda\envs
                          C:\Users\maglk\.conda\envs
               platform : win-64
             user-agent : conda/4.5.12 requests/2.21.0 CPython/3.7.1 Windows/10 Windows/10.0.17134
          administrator : True
             netrc file : None
           offline mode : False

Okay. I was facing the same problem with the Anaconda 3 2018 ver. So what I did is that I used Anaconda prompt. It automatically links the base conda files to the required proxies. just type "conda --version" in the prompt to check the prompt. Then type "conda install numpy". Voila! you are done.

Daniel Samwel Amon Ochieng Oti

DELETE to C:\Users\maglk\.condarc and then update Conda. This will solve it in Windows.

conda update conda

I got the same problem and solved. In Anaconda prompt, use pip install scp, not conda install scp

I have tried to solve this problem for some time now. Finally I figure out that you should use pip install instead of conda install. Normally we use pip install in windows command prompt and conda install in Anaconda Prompt. But for me I solved the problem by using pip install in Anaconda prompt. The output is shown below

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!