Conda: RemoveError: 'requests' is a dependency of conda and cannot be removed from conda's operating environment

Created on 27 Jan 2019  ·  128Comments  ·  Source: conda/conda

Current Behavior

Having trouble installing a third party library called bottleneck and I have not seen this error before using Windows 10 with Anaconda installed:

conda install bottleneck

Environment

Operating System: (Windows 10 Pro)
Python Version: 3.6.5

https://pastebin.com/Qz5tp09J

Steps to Reproduce

(base) C:\WINDOWS\system32>conda install bottleneck
Collecting package metadata: done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\XYZ\Anaconda3

  added / updated specs:
    - bottleneck


The following NEW packages will be INSTALLED:

  bottleneck         pkgs/main/win-64::bottleneck-1.2.1-py36h452e1ab_1
  certifi            pkgs/main/win-64::certifi-2018.11.29-py36_0
  numpy-base         pkgs/main/win-64::numpy-base-1.14.3-py36h555522e_1
  pip                pkgs/main/win-64::pip-18.1-py36_0
  setuptools         pkgs/main/win-64::setuptools-40.6.3-py36_0
  zstd               pkgs/main/win-64::zstd-1.3.7-h508b16e_0

The following packages will be UPDATED:

  ca-certificates                              2018.03.07-0 --> 2018.12.5-0
  libarchive                               3.3.2-h798a506_7 --> 3.3.3-h0643e63_5
  libpng                                  1.6.34-h79bbb47_0 --> 1.6.36-h2a8f88b_0
  openssl                                 1.0.2o-h8ea7d77_0 --> 1.1.1a-he774522_0
  python                                   3.6.5-h0c2934d_0 --> 3.6.8-h9f7ef89_0
  qt                                   5.9.5-vc14he4a7d60_0 --> 5.9.7-vc14h73c81de_0
  sqlite                                  3.23.1-h35aae40_0 --> 3.26.0-he774522_0
  vc                                          14-h0510ff6_3 --> 14.1-h0510ff6_4
  vs2015_runtime                               14.0.25123-3 --> 14.15.26706-h3a45250_0
  wheel                                       0.31.1-py36_0 --> 0.32.3-py36_0

The following packages will be DOWNGRADED:

  libssh2                                  1.8.0-hd619d38_4 --> 1.8.0-h7a1dbc1_4


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: failed

RemoveError: 'requests' is a dependency of conda and cannot be removed from
conda's operating environment.
RemoveError: 'setuptools' is a dependency of conda and cannot be removed from
conda's operating environment.
source-community tag-solver type-bug

Most helpful comment

@matthiastns Doing 'conda update --force conda' worked for me

All 128 comments

Is there any update on this?

I have the exact same problem when I try to upgrade PyTorch

I have the same on MacOS Mojave, how can I fix this thing??

Doing 'conda update conda' before it worked for me
conda version : 4.6.2

Not sure why conda deleted my comment, but re-opening this since many others have the same issue. I will let someone from the Conda team to close it when there is an appropriate solution.

RemoveError: 'requests' is a dependency of conda and cannot be removed from
conda's operating environment.

Same problem on Linux too, creating a new environment is failing with latest version of conda

I had it with setuptools instead, and updating conda fixed it.

I had the requests dependency error on MacOS with conda v4.6.2, python 3.7.2. I had miniconda installed, not sure if trying to update it with anaconda commands might have caused the error.

Anyways, doing rm -r ~/miniconda3/, removing stuff that conda had installed into ~/.bash_profile and downloading and installing new conda from package worked for me

I had the same issue (and additionally also the same problem for ruamel_yaml). I noticed that somehow in my case requests was installed with pip in my base environment. Is it possible that requests was only recently added as a Conda dependency and that Conda did not force reinstallation through Conda?

I updated the package with pip install --upgrade requests. This installed 2.21.0, which Conda apparently needs. However, it seems to still detect the conda-forge version as a higher version, because conda update conda still fails for me.

I also tried removing the pip package (pip uninstall requests), after which Conda of course stopped working. I then tried to reinstall/update my Conda installation by simply running the miniconda installer on the same prefix as my existing installation. This unfortunately failed with message

reinstalling: python.app-2-py37_9 ...
cp: /Users/pbos/sw/miniconda3/pythonapp: No such file or directory
ln: ./lib: File exists
Error: post-link failed for: python.app-2-py37_9

After this I gave up and simply reinstalled miniconda.

@satrya-sabeni's fix worked for me (updating conda with conda update conda)

conda update conda worked for me, but only after deactivating (conda deactivate) out of any current conda environments (including the base conda env)

conda update conda worked for me too.

Having the same issue while upgrading to PyTorch. I'll try @rocknamx8 solution and see if it works.

I had the same problem today, and conda update conda resolved it.

I hade the same problem, but conda update conda doesn't work

Same problem. "conda update conda" does not work on my machine either. See outcome:

Z:\>conda update conda
Collecting package metadata: done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\hm113045\AppData\Local\Continuum\Anaconda3

  added / updated specs:
    - conda


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    requests-2.21.0            |        py36_1000          84 KB  conda-forge
    ------------------------------------------------------------
                                           Total:          84 KB

The following NEW packages will be INSTALLED:

  requests           conda-forge/win-64::requests-2.21.0-py36_1000


Proceed ([y]/n)? y


Downloading and Extracting Packages
requests-2.21.0      | 84 KB     | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: failed

RemoveError: 'requests' is a dependency of conda and cannot be removed from
conda's operating environment.

@matthiastns Doing 'conda update --force conda' worked for me

@alekhka You are my hero. That solved it for me. Thank you very much.

@alekhka is my hero too. this is the only solution that worked for me as well.

Doing 'conda update --force conda' worked for me

conda update in any form did not work for me and kept throwing similar error "conda create failure--RemoveError: 'setuptools' is a dependency of conda and cannot be removed from conda's operating environment.

Updating Anaconda Navigator fixed my issue.

I find those conda update conda answers flawed in one fundamental way; this will force upon you a newer minor version of python, something that's not always responsible within a larger suite of dependencies and considerations.

I tried conda deactivate and then conda update --force conda but still get the error:

RemoveError: 'setuptools' is a dependency of conda and cannot be removed from
conda's operating environment.

Conda-Version: 4.6.11-py36_0
Mac-OS: 10.14.3

Any further ideas?

Was able to update my conda environemnt after updating the conda navigator using the command line: conda update anaconda-navigator

Can confirm this bug persists on OSX. Trying conda update conda and conda update --force conda both did not work. It keeps getting hung up on "inconsistent environment" and both the requests and the setuptools packages being dependencies that cannot be removed from conda's operating environment. Really weird.

Preparing transaction: done
Verifying transaction: failed

RemoveError: 'requests' is a dependency of conda and cannot be removed from
conda's operating environment.
RemoveError: 'setuptools' is a dependency of conda and cannot be removed from
conda's operating environment.

those two RemoveErrors still persist, and after hours of trying various solutions, I surrendered and try to uninstall Anaconda with Anaconda Clean. Much to my chagrin, conda install anaconda-clean also produces the same RemoveErrors.

Finally surrendered-surrendered and just did rm -rf /anaconda3 . Disappointed being forced into this last resort outcome.

I'm using pip instead for now, because updating conda itself would upgrade my python to 7.3, which some of my packages won't work well with. This is a weird one, I hope it was specific to a particular version of conda that all of us here have installed.

@matanster wow, can conda really upgrade your python to that high? 😁

setuptools is not installed by conda but pip, so you need to uninstall setuptools by pip

pip uninstall setuptools

and reinstall it though conda:

conda install setuptools

Thanks but not sure how using sudo doesn't introduce a new problem, the new problem being that now your python packages are run as root (what am I missing in that regard?). anyway uninstalling pip didn't work for me.

as to your side note @bounlu, yes it does, not that I want 7.3 actually.

@matanster how? 7.3 is not out yet 😅

also on Mojave 10.14. I am now unable to add any new conda environments without the error, which follows the notice that it will install setuptools. i also can't update any packages, and my list of inconsistencies has grown tremendously.

RemoveError: 'setuptools' is a dependency of conda and cannot be removed from
conda's operating environment.

none of the suggestions for updating conda or conda force work.

Preparing transaction: done
Verifying transaction: failed

RemoveError: 'setuptools' is a dependency of conda and cannot be removed from
conda's operating environment.

(base) C:Usersstonepc>conda config --show-source
==> C:Usersstonepc.condarc <==
ssl_verify: True
channels:

  • defaults
  • conda-forge
    show_channel_urls: True

(base) C:Usersstonepc>conda deactivate

C:Usersstonepc>conda update conda
Collecting package metadata: |
.................

No luck for me. Still the same RemoveError for setuptools

setuptools is not installed by conda but pip, so you need to uninstall setuptools by pip

pip uninstall setuptools

and reinstall it though conda:

conda install setuptools

Great!

The same problem.
Now I can't install or upgrade any package by conda command because of the "setuptools problem".
Maybe reinstall the conda enviroment can fix the problem, you can try it, but for me, I am using a shared server so I can't change it as one pleases.

I got the same issue with setuptools, as of today.

setuptools is not installed by conda but pip, so you need to uninstall setuptools by pip

pip uninstall setuptools

and reinstall it though conda:

conda install setuptools

did NOT work for me, it removes setup tools just fine, but then conda install setuptools fails with the very same error

RemoveError: 'setuptools' is a dependency of conda and cannot be removed from
conda's operating environment.

im using pip instead, hope this issue could be solved, rather than reinstall whole annaconda.

https://github.com/conda/conda/issues/8149#issuecomment-479483339

Conda Version: 4.6.14

I encountered the error RemoveError: 'setuptools' is a dependency of conda and cannot be removed from conda's operating environment. when running conda env update on an active environment.

I deactivated the environment and tried running conda update --all, but got the same error.

The error was fixed by running conda update --force conda . This successfully ran without the setuptools dependency error. I was able to activate my environment and then update the packages from a .yml file.

Mac OS
Python 3.6.7
Somehow, everything is messed up in my Conda that I can't install any new package. It is driving me crazy lol.

conda update conda does not work.
conda update --force conda does not work.
pip uninstall setuptools does not work.

Keeps getting

RemoveError: 'requests' is a dependency of conda and cannot be removed from
conda's operating environment.
RemoveError: 'setuptools' is a dependency of conda and cannot be removed from
conda's operating environment.

PS: tried in base Conda and also deactivate Conda

I re-install/heal the conda at the end. Glad other env is not totally messed.

I will be reinstalling too. Wondering if there's a clean uninstall to use first.

After reinstalling, this issue happens to me again. Though this time, conda update --force conda works. No idea what is going on...

@YubinXie it could mean your uninstalling part had left intact leftovers in place on your machine. There should be some uninstallation procedure / command somewhere I guess.

@matanster Yesterday it works fine. I do not think it was due to leftover...

Today I created a new env install and was playing with different version Numpy Matplotlib, and I think it could be triggered by uninstalling package.

you can try: conda update anaconda

when i try conda install -c anaconda setuptools , it works! the code seems to reinstall the dependency.

@matthiastns Doing 'conda update --force conda' worked for me

Obi-wan has taught you well

I ran into this when trying to uninstall pytorch.

I tried everything listed above:

conda deactivate
conda update conda # fail
conda update --force conda # fail
pip uninstall setuptools # not installed with pip
conda install setuptools # fail
conda install -c anaconda setuptools # fail

Every time I get: RemoveError: 'setuptools' is a dependency of conda and cannot be removed from conda's operating environment.

So I will be completely uninstalling and reinstalling Anaconda.

@kylemcdonald I have the same feeling that the issues are caused by uninstalling packages.

I think the operation do not find the setuptools. You can try conda install setuptools first. It works for me.

when i try conda install -c anaconda setuptools , it works! the code seems to reinstall the dependency.

This worked for me, thanks

I have the same problem and also try everything above and also not working.
Finally, I remove the aconda-navigator and re-install and update conda . and problem solve.

I'm on macOS and conda install -c anaconda setuptools did indeed work after everything else (haven't tried reinstalling conda itself yet) failed. Thanks!

$ conda update --force conda                                                                                                                  1


WARNING: The --force flag will be removed in a future conda release.
         See 'conda update --help' for details about the --force-reinstall
         and --clobber flags.


Collecting package metadata (current_repodata.json): done
Solving environment: failed
Collecting package metadata (repodata.json): done
Solving environment: /
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:

  - defaults/osx-64::pytest-openfiles==0.2.0=py36_0
  - defaults/osx-64::scrapy==1.5.0=py36_0
  - defaults/osx-64::datashape==0.5.4=py36hfb22df8_0
  - defaults/osx-64::pandas==0.22.0=py36h0a44026_0
  - defaults/osx-64::statsmodels==0.8.0=py36h9c68fc9_0
  - defaults/osx-64::pytest-astropy==0.2.1=py36_0
  - defaults/osx-64::pylint==1.8.2=py36_0
  - defaults/osx-64::anaconda-client==1.6.14=py36_0
  - https://repo.anaconda.com/pkgs/free/osx-64::service_identity==17.0.0=py36_0
  - defaults/osx-64::spyder==3.2.7=py36_0
  - defaults/osx-64::bleach==2.1.3=py36_0
  - defaults/osx-64::h5py==2.7.1=py36h39cdac5_0
  - defaults/osx-64::bottleneck==1.2.1=py36hbd380ad_0
  - defaults/osx-64::flask==0.12.2=py36h5658096_0
  - defaults/osx-64::scipy==1.0.0=py36h1de22e9_0
  - defaults/osx-64::notebook==5.4.0=py36_0
  - defaults/osx-64::flask-cors==3.0.3=py36h7387b97_0
  - defaults/osx-64::wheel==0.30.0=py36h5eb2c71_1
  - defaults/osx-64::zope.interface==4.5.0=py36h1de35cc_0
  - defaults/osx-64::pytest==3.4.2=py36_0
  - defaults/osx-64::ipywidgets==7.1.2=py36_0
  - https://repo.anaconda.com/pkgs/free/osx-64::twisted==17.5.0=py36_0
  - soumith/osx-64::torchvision==0.1.9=py36_1
  - defaults/osx-64::jupyter_console==5.2.0=py36hccf5b1c_1
  - defaults/osx-64::pytest-remotedata==0.2.0=py36_0
  - defaults/osx-64::jupyter==1.0.0=py36_4
  - defaults/osx-64::scikit-image==0.13.1=py36h1de35cc_1
  - defaults/osx-64::blaze==0.11.3=py36h02e7a37_0
  - defaults/osx-64::anaconda-navigator==1.8.3=py36_0
  - defaults/osx-64::astropy==3.0=py36h917ab60_1
  - defaults/osx-64::scikit-learn==0.19.1=py36hffbff8c_0
  - defaults/osx-64::babel==2.5.3=py36_0
  - defaults/osx-64::parsel==1.4.0=py36_0
  - defaults/osx-64::pytest-runner==4.2=py36_0
  - defaults/osx-64::clyent==1.2.2=py36hae3ad88_0
  - defaults/osx-64::widgetsnbextension==3.1.4=py36_0
  - defaults/osx-64::jinja2==2.10=py36hd36f9c5_0
  - defaults/osx-64::odo==0.5.1=py36hc1af34a_0
  - defaults/osx-64::isort==4.3.4=py36_0
  - defaults/osx-64::pywavelets==0.5.2=py36h2710a04_0
  - defaults/osx-64::numba==0.37.0=np114py36h210bcc1_0
  - soumith/osx-64::pytorch==0.3.1=py36_cuda0.0_cudnn0.0_2
  - defaults/osx-64::ipykernel==4.8.2=py36_0
  - defaults/osx-64::numpydoc==0.7.0=py36he54d08e_0
  - defaults/osx-64::astroid==1.6.1=py36_0
  - defaults/osx-64::pyflakes==1.6.0=py36hea45e83_0
  - defaults/osx-64::bokeh==0.12.14=py36_0
  - defaults/osx-64::seaborn==0.8.1=py36h595ecd9_0
  - defaults/osx-64::numexpr==2.6.4=py36habcfcfe_0
  - defaults/osx-64::anaconda-project==0.8.2=py36h9ee5d53_0
  - defaults/osx-64::urllib3==1.22=py36h68b9469_0
  - defaults/osx-64::pytest-arraydiff==0.2=py36_0
  - defaults/osx-64::cython==0.27.3=py36h6ecb376_0
  - defaults/osx-64::conda==4.7.5=py36_0
  - defaults/osx-64::pytables==3.4.2=py36hfbd7ab0_2
  - defaults/osx-64::nbformat==4.4.0=py36h827af21_0
  - defaults/osx-64::qtconsole==4.3.1=py36hd96c0ff_0
  - defaults/osx-64::pygments==2.2.0=py36h240cd3f_0
  - defaults/osx-64::patsy==0.5.0=py36_0
  - defaults/osx-64::pytest-doctestplus==0.1.2=py36_0
  - defaults/osx-64::jsonschema==2.6.0=py36hb385e00_0
  - defaults/osx-64::anaconda==custom=py36ha4fed55_0
  - defaults/osx-64::sphinx==1.7.1=py36_0
  - defaults/osx-64::automat==0.6.0=py36hda01bcc_0
  - defaults/osx-64::matplotlib==2.2.0=py36hfa7797c_0
  - defaults/osx-64::nbconvert==5.3.1=py36h810822e_0
  - defaults/osx-64::imageio==2.2.0=py36h5e01289_0
  - defaults/osx-64::nose==1.3.7=py36h73fae2b_2
  - defaults/osx-64::dask==0.17.1=py36_0
done

## Package Plan ##

  environment location: /Users/evar/anaconda

  added / updated specs:
    - conda


The following NEW packages will be INSTALLED:

  _anaconda_depends  pkgs/main/osx-64::_anaconda_depends-5.1.0-py36_2
  alabaster          pkgs/main/osx-64::alabaster-0.7.12-py36_0
  appscript          pkgs/main/osx-64::appscript-1.1.0-py36h1de35cc_0
  attrs              pkgs/main/osx-64::attrs-19.1.0-py36_1
  backcall           pkgs/main/osx-64::backcall-0.1.0-py36_0
  backports          pkgs/main/noarch::backports-1.0-py_2
  backports.os       pkgs/main/osx-64::backports.os-0.1.1-py36_0
  backports.shutil_~ pkgs/main/osx-64::backports.shutil_get_terminal_size-1.0.0-py36_2
  beautifulsoup4     pkgs/main/osx-64::beautifulsoup4-4.7.1-py36_1
  bitarray           pkgs/main/osx-64::bitarray-0.9.3-py36h1de35cc_0
  bkcharts           pkgs/main/osx-64::bkcharts-0.2-py36h073222e_0
  blas               pkgs/main/osx-64::blas-1.0-mkl
  boto               pkgs/main/osx-64::boto-2.49.0-py36_0
  bzip2              pkgs/main/osx-64::bzip2-1.0.7-h1de35cc_0
  cffi               pkgs/main/osx-64::cffi-1.12.3-py36hb5b8e2f_0
  chardet            pkgs/main/osx-64::chardet-3.0.4-py36_1
  click              pkgs/main/osx-64::click-7.0-py36_0
  cloudpickle        pkgs/main/noarch::cloudpickle-1.2.1-py_0
  colorama           pkgs/main/osx-64::colorama-0.4.1-py36_0
  constantly         pkgs/main/osx-64::constantly-15.1.0-py36h28b3542_0
  cytoolz            pkgs/main/osx-64::cytoolz-0.9.0.1-py36h1de35cc_1
  dbus               pkgs/main/osx-64::dbus-1.13.6-h90a0687_0
  decorator          pkgs/main/osx-64::decorator-4.4.0-py36_1
  distributed        pkgs/main/osx-64::distributed-1.21.8-py36_0
  entrypoints        pkgs/main/osx-64::entrypoints-0.3-py36_0
  expat              pkgs/main/osx-64::expat-2.2.6-h0a44026_0
  fastcache          pkgs/main/osx-64::fastcache-1.1.0-py36h1de35cc_0
  filelock           pkgs/main/noarch::filelock-3.0.12-py_0
  gevent             pkgs/main/osx-64::gevent-1.4.0-py36h1de35cc_0
  glib               pkgs/main/osx-64::glib-2.56.2-hd9629dc_0
  glob2              pkgs/main/noarch::glob2-0.7-py_0
  gmpy2              pkgs/main/osx-64::gmpy2-2.0.8-py36h6ef4df4_2
  greenlet           pkgs/main/osx-64::greenlet-0.4.15-py36h1de35cc_0
  html5lib           pkgs/main/osx-64::html5lib-1.0.1-py36_0
  hyperlink          pkgs/main/noarch::hyperlink-19.0.0-py_0
  idna               pkgs/main/osx-64::idna-2.8-py36_0
  imagesize          pkgs/main/osx-64::imagesize-1.1.0-py36_0
  importlib_metadata pkgs/main/osx-64::importlib_metadata-0.17-py36_1
  incremental        pkgs/main/osx-64::incremental-17.5.0-py36_0
  intel-openmp       pkgs/main/osx-64::intel-openmp-2019.4-233
  ipython            pkgs/main/osx-64::ipython-7.6.0-py36h39e3cac_0
  itsdangerous       pkgs/main/osx-64::itsdangerous-1.1.0-py36_0
  jdcal              pkgs/main/noarch::jdcal-1.4.1-py_0
  jedi               pkgs/main/osx-64::jedi-0.13.3-py36_0
  jupyter_client     pkgs/main/osx-64::jupyter_client-5.2.4-py36_0
  jupyter_core       pkgs/main/noarch::jupyter_core-4.5.0-py_0
  jupyterlab         pkgs/main/osx-64::jupyterlab-0.35.5-py36hf63ae98_0
  jupyterlab_launch~ pkgs/main/osx-64::jupyterlab_launcher-0.13.1-py36_0
  jupyterlab_server  pkgs/main/osx-64::jupyterlab_server-0.2.0-py36_0
  kiwisolver         pkgs/main/osx-64::kiwisolver-1.1.0-py36h0a44026_0
  lazy-object-proxy  pkgs/main/osx-64::lazy-object-proxy-1.4.1-py36h1de35cc_0
  libcxx             pkgs/main/osx-64::libcxx-4.0.1-hcfea43d_1
  libcxxabi          pkgs/main/osx-64::libcxxabi-4.0.1-hcfea43d_1
  libpng             pkgs/main/osx-64::libpng-1.6.37-ha441bb4_0
  libsodium          pkgs/main/osx-64::libsodium-1.0.16-h3efe00b_0
  libtiff            pkgs/main/osx-64::libtiff-4.0.10-hcb84e12_2
  libxslt            pkgs/main/osx-64::libxslt-1.1.33-h33a18ac_0
  lxml               pkgs/main/osx-64::lxml-4.3.4-py36hef8c89e_0
  markupsafe         pkgs/main/osx-64::markupsafe-1.1.1-py36h1de35cc_0
  mccabe             pkgs/main/osx-64::mccabe-0.6.1-py36_1
  mistune            pkgs/main/osx-64::mistune-0.8.4-py36h1de35cc_0
  mkl                pkgs/main/osx-64::mkl-2018.0.3-1
  mkl-service        pkgs/main/osx-64::mkl-service-1.1.2-py36h6b9c3cc_5
  mkl_fft            pkgs/main/osx-64::mkl_fft-1.0.1-py36h917ab60_0
  mkl_random         pkgs/main/osx-64::mkl_random-1.0.1-py36h78cc56f_0
  mpc                pkgs/main/osx-64::mpc-1.1.0-h6ef4df4_1
  mpfr               pkgs/main/osx-64::mpfr-4.0.1-h3018a27_3
  mpmath             pkgs/main/osx-64::mpmath-1.1.0-py36_0
  msgpack-python     pkgs/main/osx-64::msgpack-python-0.6.1-py36h04f5b5a_1
  multipledispatch   pkgs/main/osx-64::multipledispatch-0.6.0-py36_0
  networkx           pkgs/main/noarch::networkx-2.3-py_0
  nltk               pkgs/main/osx-64::nltk-3.4.3-py36_0
  numpy              pkgs/main/osx-64::numpy-1.14.2-py36ha9ae307_1
  olefile            pkgs/main/osx-64::olefile-0.46-py36_0
  openpyxl           pkgs/main/noarch::openpyxl-2.6.2-py_0
  packaging          pkgs/main/osx-64::packaging-19.0-py36_0
  pandoc             pkgs/main/osx-64::pandoc-2.2.3.2-0
  pandocfilters      pkgs/main/osx-64::pandocfilters-1.4.2-py36_1
  parso              pkgs/main/noarch::parso-0.5.0-py_0
  partd              pkgs/main/noarch::partd-1.0.0-py_0
  path.py            pkgs/main/noarch::path.py-12.0.1-py_0
  pathlib2           pkgs/main/osx-64::pathlib2-2.3.4-py36_0
  pcre               pkgs/main/osx-64::pcre-8.43-h0a44026_0
  pexpect            pkgs/main/osx-64::pexpect-4.7.0-py36_0
  pickleshare        pkgs/main/osx-64::pickleshare-0.7.5-py36_0
  pillow             pkgs/main/osx-64::pillow-5.1.0-py36hfcce615_0
  pip                pkgs/main/osx-64::pip-19.1.1-py36_0
  pkginfo            pkgs/main/osx-64::pkginfo-1.5.0.1-py36_0
  pluggy             pkgs/main/osx-64::pluggy-0.6.0-py36_0
  prompt_toolkit     pkgs/main/osx-64::prompt_toolkit-2.0.9-py36_0
  psutil             pkgs/main/osx-64::psutil-5.6.3-py36h1de35cc_0
  ptyprocess         pkgs/main/osx-64::ptyprocess-0.6.0-py36_0
  py                 pkgs/main/osx-64::py-1.8.0-py36_0
  pyasn1             pkgs/main/noarch::pyasn1-0.4.5-py_0
  pyasn1-modules     pkgs/main/osx-64::pyasn1-modules-0.2.4-py36_0
  pycodestyle        pkgs/main/osx-64::pycodestyle-2.5.0-py36_0
  pycosat            pkgs/main/osx-64::pycosat-0.6.3-py36h1de35cc_0
  pycparser          pkgs/main/osx-64::pycparser-2.19-py36_0
  pycrypto           pkgs/main/osx-64::pycrypto-2.6.1-py36h1de35cc_9
  pydispatcher       pkgs/main/osx-64::pydispatcher-2.0.5-py36_1
  pyodbc             pkgs/main/osx-64::pyodbc-4.0.26-py36h0a44026_0
  pyopenssl          pkgs/main/osx-64::pyopenssl-19.0.0-py36_0
  pyparsing          pkgs/main/noarch::pyparsing-2.4.0-py_0
  pyqt               pkgs/main/osx-64::pyqt-5.9.2-py36h655552a_2
  pysocks            pkgs/main/osx-64::pysocks-1.7.0-py36_0
  python-dateutil    pkgs/main/osx-64::python-dateutil-2.8.0-py36_0
  python.app         pkgs/main/osx-64::python.app-2-py36_9
  pytz               pkgs/main/noarch::pytz-2019.1-py_0
  pyyaml             pkgs/main/osx-64::pyyaml-5.1.1-py36h1de35cc_0
  pyzmq              pkgs/main/osx-64::pyzmq-18.0.0-py36h0a44026_0
  qt                 pkgs/main/osx-64::qt-5.9.7-h468cd18_1
  qtawesome          pkgs/main/osx-64::qtawesome-0.5.7-py36_1
  qtpy               pkgs/main/noarch::qtpy-1.8.0-py_0
  readline           pkgs/main/osx-64::readline-7.0-h1de35cc_5
  requests           pkgs/main/osx-64::requests-2.22.0-py36_0
  rope               pkgs/main/noarch::rope-0.14.0-py_0
  ruamel_yaml        pkgs/main/osx-64::ruamel_yaml-0.15.46-py36h1de35cc_0
  setuptools         pkgs/main/osx-64::setuptools-41.0.1-py36_0
  sip                pkgs/main/osx-64::sip-4.19.8-py36h0a44026_0
  six                pkgs/main/osx-64::six-1.12.0-py36_0
  snowballstemmer    pkgs/main/noarch::snowballstemmer-1.9.0-py_0
  sortedcollections  pkgs/main/osx-64::sortedcollections-1.1.2-py36_0
  sortedcontainers   pkgs/main/osx-64::sortedcontainers-2.1.0-py36_0
  soupsieve          pkgs/main/osx-64::soupsieve-1.8-py36_0
  sphinxcontrib      pkgs/main/osx-64::sphinxcontrib-1.0-py36_1
  sphinxcontrib-web~ pkgs/main/noarch::sphinxcontrib-websupport-1.1.2-py_0
  sqlalchemy         pkgs/main/osx-64::sqlalchemy-1.3.5-py36h1de35cc_0
  sympy              pkgs/main/osx-64::sympy-1.4-py36_0
  tblib              pkgs/main/noarch::tblib-1.4.0-py_0
  terminado          pkgs/main/osx-64::terminado-0.8.2-py36_0
  testpath           pkgs/main/osx-64::testpath-0.4.2-py36_0
  tornado            pkgs/main/osx-64::tornado-5.1.1-py36h1de35cc_0
  unixodbc           pkgs/main/osx-64::unixodbc-2.3.7-h1de35cc_0
  w3lib              pkgs/main/osx-64::w3lib-1.20.0-py36_0
  webencodings       pkgs/main/osx-64::webencodings-0.5.1-py36_1
  werkzeug           pkgs/main/noarch::werkzeug-0.15.4-py_0
  wrapt              pkgs/main/osx-64::wrapt-1.11.2-py36h1de35cc_0
  xlrd               pkgs/main/osx-64::xlrd-1.2.0-py36_0
  xlsxwriter         pkgs/main/noarch::xlsxwriter-1.1.8-py_0
  xlwings            pkgs/main/osx-64::xlwings-0.15.8-py36_0
  zeromq             pkgs/main/osx-64::zeromq-4.3.1-h0a44026_3
  zict               pkgs/main/noarch::zict-1.0.0-py_0
  zipp               pkgs/main/noarch::zipp-0.5.1-py_0
  zlib               pkgs/main/osx-64::zlib-1.2.11-h1de35cc_3
  zope               pkgs/main/osx-64::zope-1.0-py36_1


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: / ERROR conda.core.link:_execute_post_link_actions(720): An error occurred while installing package 'defaults::qt-5.9.7-h468cd18_1'.
LinkError: post-link script failed for package defaults::qt-5.9.7-h468cd18_1
running your command again with `-v` will provide additional information
location of failed script: /Users/evar/anaconda/bin/.qt-post-link.sh
==> script messages <==
<None>

Attempting to roll back.

done
ERROR conda.core.link:_execute(637): An error occurred while installing package 'defaults::qt-5.9.7-h468cd18_1'.
LinkError: post-link script failed for package defaults::qt-5.9.7-h468cd18_1
running your command again with `-v` will provide additional information
location of failed script: /Users/evar/anaconda/bin/.qt-post-link.sh
==> script messages <==
<None>

Attempting to roll back.

Rolling back transaction: done

LinkError: post-link script failed for package defaults::qt-5.9.7-h468cd18_1
running your command again with `-v` will provide additional information
location of failed script: /Users/evar/anaconda/bin/.qt-post-link.sh
==> script messages <==
<None>

()
AssertionError()

I had the same problem with setuptools while installing pylint. I could fix it while using a combination of a couple of suggestions from here. This is what I did:

  • (my environment) pip uninstall setuptools
  • if setuptools installed in base: (base) pip uninstall setuptools
  • (base) conda install -c anaconda setuptools
  • (base) conda update --force conda
  • (my environment) conda install -c anaconda setuptools
  • (my environment) conda install -c anaconda pylint

@NightMachinary did you have your solution? I face the same problem on Google Virtual Machine with its default anaconda. It's suck to have to copy my data to a new instance, because if I snapshot the disk, the faulty conda will move along as well.

conda install -c anaconda setuptools

worked for me! The rest did not! Miniconda install, after playing with pip install pyqt5

conda install -c anaconda setuptools
conda update --force conda
both do not work for me.
Any other solution?

I deleted conda’s directory and reinstalled.

On Thu, Jul 11, 2019 at 7:19 PM Phúc Lê notifications@github.com wrote:

@NightMachinary https://github.com/NightMachinary did you have your
solution? I face the same problem on Google Virtual Machine with its
default anaconda. It's suck to have to copy my data to a new instance,
because if I snapshot the disk, the faulty conda will move along as well.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/conda/conda/issues/8149?email_source=notifications&email_token=AIUL56R53FFN4QBD3BL7WHDP65B5ZA5CNFSM4GST3QP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZW6GCY#issuecomment-510518027,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIUL56TXXFXNXGOZEATT4RLP65B5ZANCNFSM4GST3QPQ
.

@matthiastns Doing 'conda update --force conda' worked for me

Hi. I was facing the "setuptools" problem as others, and I tried your solution. But now my anaconda is messed up badly. No command starting with "conda" works, and I keep getting the following error:

Traceback (most recent call last):
  File "D:\Anaconda\lib\site-packages\conda\exceptions.py", line 1043, in __call__
    return func(*args, **kwargs)
  File "D:\Anaconda\lib\site-packages\conda\cli\main.py", line 84, in _main
    exit_code = do_call(args, p)
  File "D:\Anaconda\lib\site-packages\conda\cli\conda_argparse.py", line 80, in do_call
    module = import_module(relative_mod, __name__.rsplit('.', 1)[0])
  File "D:\Anaconda\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "D:\Anaconda\lib\site-packages\conda\cli\main_list.py", line 14, in <module>
    from ..core.prefix_data import PrefixData
  File "D:\Anaconda\lib\site-packages\conda\core\prefix_data.py", line 24, in <module>
    from ..gateways.disk.create import write_as_json_to_file
  File "D:\Anaconda\lib\site-packages\conda\gateways\disk\create.py", line 17, in <module>
    import conda_package_handling.api
  File "D:\Anaconda\lib\site-packages\conda_package_handling\api.py", line 3, in <module>
    from libarchive.exception import ArchiveError as _LibarchiveArchiveError
  File "D:\Anaconda\lib\site-packages\libarchive\__init__.py", line 1, in <module>
    from .entry import ArchiveEntry
  File "D:\Anaconda\lib\site-packages\libarchive\entry.py", line 6, in <module>
    from . import ffi
  File "D:\Anaconda\lib\site-packages\libarchive\ffi.py", line 27, in <module>
    libarchive = ctypes.cdll.LoadLibrary(libarchive_path)
  File "D:\Anaconda\lib\ctypes\__init__.py", line 434, in LoadLibrary
    return self._dlltype(name)
  File "D:\Anaconda\lib\ctypes\__init__.py", line 356, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "D:\Anaconda\Scripts\conda-script.py", line 12, in <module>
    sys.exit(main())
  File "D:\Anaconda\lib\site-packages\conda\cli\main.py", line 150, in main
    return conda_exception_handler(_main, *args, **kwargs)
  File "D:\Anaconda\lib\site-packages\conda\exceptions.py", line 1335, in conda_exception_handler
    return_value = exception_handler(func, *args, **kwargs)
  File "D:\Anaconda\lib\site-packages\conda\exceptions.py", line 1046, in __call__
    return self.handle_exception(exc_val, exc_tb)
  File "D:\Anaconda\lib\site-packages\conda\exceptions.py", line 1090, in handle_exception
    return self.handle_unexpected_exception(exc_val, exc_tb)
  File "D:\Anaconda\lib\site-packages\conda\exceptions.py", line 1101, in handle_unexpected_exception
    self.print_unexpected_error_report(error_report)
  File "D:\Anaconda\lib\site-packages\conda\exceptions.py", line 1171, in print_unexpected_error_report
    from .cli.main_info import get_env_vars_str, get_main_info_str
  File "D:\Anaconda\lib\site-packages\conda\cli\main_info.py", line 19, in <module>
    from ..core.index import _supplement_index_with_system
  File "D:\Anaconda\lib\site-packages\conda\core\index.py", line 9, in <module>
    from .package_cache_data import PackageCacheData
  File "D:\Anaconda\lib\site-packages\conda\core\package_cache_data.py", line 15, in <module>
    from conda_package_handling.api import InvalidArchiveError
  File "D:\Anaconda\lib\site-packages\conda_package_handling\api.py", line 7, in <module>
    from .tarball import CondaTarBZ2 as _CondaTarBZ2
  File "D:\Anaconda\lib\site-packages\conda_package_handling\tarball.py", line 7, in <module>
    import libarchive
  File "D:\Anaconda\lib\site-packages\libarchive\__init__.py", line 1, in <module>
    from .entry import ArchiveEntry
  File "D:\Anaconda\lib\site-packages\libarchive\entry.py", line 6, in <module>
    from . import ffi
  File "D:\Anaconda\lib\site-packages\libarchive\ffi.py", line 27, in <module>
    libarchive = ctypes.cdll.LoadLibrary(libarchive_path)
  File "D:\Anaconda\lib\ctypes\__init__.py", line 434, in LoadLibrary
    return self._dlltype(name)
  File "D:\Anaconda\lib\ctypes\__init__.py", line 356, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

I'd be glad if anyone can help me fix this problem. Thanks.

First, make sure that you don't just have a library load problem. The SSL and MKL sections here also apply to libarchive, which some of the posted messages are showing: https://conda.io/projects/conda/en/latest/user-guide/troubleshooting.html

If things really are broken, sometimes it helps to download miniconda and install it over the current installation. You may lose your command history, but you'll restore conda. Force install instructions are at https://docs.anaconda.com/anaconda/install/silent-mode/

For me I uninstall the setuptools by pip outside the environment.
/disk1/home/wangbx/anaconda3/bin/pip uninstall setuptools
But after that

conda update conda
conda update --force conda

still does not work.
But conda install -c anaconda setuptools works well~

But there is still tens of packages that are inconsistent

The following packages are causing the inconsistency:

  - defaults/linux-64::pytest-doctestplus==0.3.0=py37_0
  - anaconda/linux-64::caffe-gpu==1.0=py37h999e8d7_5
  - defaults/linux-64::tensorboard==1.14.0=py37hf484d3e_0
  - defaults/linux-64::cython==0.29.6=py37he6710b0_0
  - defaults/linux-64::pytest==4.3.1=py37_0
  - defaults/linux-64::numpydoc==0.8.0=py37_0
  - defaults/linux-64::pytest-remotedata==0.3.1=py37_0
  - defaults/linux-64::nbformat==4.4.0=py37_0
  - defaults/linux-64::seaborn==0.9.0=py37_0
  - defaults/linux-64::conda-build==3.17.8=py37_0
  - defaults/linux-64::anaconda-navigator==1.9.7=py37_0
  - defaults/linux-64::sphinx==1.8.5=py37_0
  - defaults/linux-64::clyent==1.2.2=py37_1
  - defaults/linux-64::spyder==3.3.3=py37_0
  - defaults/noarch::tensorflow-estimator==1.14.0=py_0
  - defaults/linux-64::jupyter==1.0.0=py37_7
  - defaults/linux-64::dask==1.1.4=py37_1
  - defaults/linux-64::wheel==0.33.1=py37_0
  - defaults/linux-64::pygments==2.3.1=py37_0
  - defaults/linux-64::jinja2==2.10=py37_0
  - defaults/linux-64::jupyterlab==0.35.4=py37hf63ae98_0
  - defaults/linux-64::ipykernel==5.1.0=py37h39e3cac_0
  - defaults/linux-64::spyder-kernels==0.4.2=py37_0
  - defaults/linux-64::tensorflow==1.14.0=mkl_py37h45c423b_0
  - defaults/linux-64::_ipyw_jlab_nb_ext_conf==0.1.0=py37_0
  - defaults/linux-64::astroid==2.2.5=py37_0
  - defaults/linux-64::jupyterlab_server==0.2.0=py37_0
  - defaults/linux-64::keras==2.2.4=0
  - defaults/linux-64::flask==1.0.2=py37_1
  - defaults/linux-64::jsonschema==3.0.1=py37_0
  - defaults/linux-64::bokeh==1.0.4=py37_0
  - defaults/linux-64::nbconvert==5.4.1=py37_3
  - defaults/linux-64::conda-verify==3.1.1=py37_0
  - defaults/linux-64::jupyter_console==6.0.0=py37_0
  - defaults/linux-64::isort==4.3.16=py37_0
  - defaults/linux-64::matplotlib==3.0.3=py37h5429711_0
  - defaults/linux-64::tensorflow-base==1.14.0=mkl_py37h7ce6ba3_0
  - defaults/linux-64::pylint==2.3.1=py37_0
  - defaults/linux-64::ipywidgets==7.4.2=py37_0
  - defaults/linux-64::prompt_toolkit==2.0.9=py37_0
  - anaconda/linux-64::protobuf==3.8.0=py37he6710b0_0
  - defaults/linux-64::widgetsnbextension==3.4.2=py37_0
  - defaults/linux-64::astropy==3.1.2=py37h7b6447c_0
  - defaults/linux-64::nose==1.3.7=py37_2
  - defaults/linux-64::pytest-arraydiff==0.3=py37h39e3cac_0
  - defaults/linux-64::grpcio==1.16.1=py37hf8bcb03_1
  - defaults/linux-64::scikit-image==0.14.2=py37he6710b0_0
  - defaults/linux-64::pytest-openfiles==0.3.2=py37_0
  - defaults/linux-64::notebook==5.7.8=py37_0
  - defaults/linux-64::networkx==2.2=py37_1
  - defaults/linux-64::anaconda-client==1.7.2=py37_0
  - defaults/linux-64::anaconda-project==0.8.2=py37_0
  - defaults/linux-64::qtconsole==4.4.3=py37_0
  - defaults/linux-64::ipython==7.4.0=py37h39e3cac_0
  - defaults/linux-64::markdown==3.1.1=py37_0
  - defaults/linux-64::pytest-astropy==0.5.0=py37_0
  - defaults/linux-64::bleach==3.1.0=py37_0
done

None of the above solutions worked for me. What's going on with conda these days?

Setuptools issues might have been related to this: https://github.com/conda/conda/pull/9014

Can't speak for requests and the others, though. That may be bad interaction with pip-installed stuff, but without a simple reproducible test case, it's impossible to say.

What's going on with conda these days?

We have changed the solving behavior pretty dramatically recently. We also added a new library dependency, libarchive, which in turn has other library dependencies. More can go wrong. We certainly don't like the instability, but it is improving and we think the speed is worth it.

https://www.anaconda.com/understanding-and-improving-condas-performance/
https://www.anaconda.com/how-we-made-conda-faster-4-7/
https://www.anaconda.com/why-we-removed-the-free-channel-in-conda-4-7/

@msarahan Thank you for working on it, and I feel sorry for you to receive hostile comments...

Conda has a huge number of users, and it is really important for everyone's work. It being broken is really frustrating and could drive ppl crazy. I felt upset when it was broken. But I think it is unfair to blame you on these issues... Thank you for your contribution and hope you do not get upset by these comments...

im using pip instead, hope this issue could be solved, rather than reinstall whole annaconda.

At long last, i have to delete current installations and reinstall miniconda instead. Problem solved, and i can use conda install now.

Ensure your setuptools has uninstalled and try more with conda update --force conda.

After running conda update --force conda, whenever I run conda update, I got such errors:

conda update --all
Traceback (most recent call last):
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/gateways/connection/__init__.py", line 21, in <module>
    from requests import ConnectionError, HTTPError, Session
ModuleNotFoundError: No module named 'requests'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1062, in __call__
    return func(*args, **kwargs)
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/cli/main.py", line 84, in _main
    exit_code = do_call(args, p)
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/cli/conda_argparse.py", line 80, in do_call
    module = import_module(relative_mod, __name__.rsplit('.', 1)[0])
  File "/home/phil/anaconda3/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/cli/main_update.py", line 8, in <module>
    from .install import install
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/cli/install.py", line 19, in <module>
    from ..core.index import calculate_channel_urls, get_index
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/core/index.py", line 9, in <module>
    from .package_cache_data import PackageCacheData
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/core/package_cache_data.py", line 17, in <module>
    from .path_actions import CacheUrlAction, ExtractPackageAction
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/core/path_actions.py", line 30, in <module>
    from ..gateways.connection.download import download
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/gateways/connection/__init__.py", line 38, in <module>
    from pip._vendor.requests import ConnectionError, HTTPError, Session
ModuleNotFoundError: No module named 'pip._vendor'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/gateways/connection/__init__.py", line 21, in <module>
    from requests import ConnectionError, HTTPError, Session
ModuleNotFoundError: No module named 'requests'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/phil/anaconda3/bin/conda", line 13, in <module>
    sys.exit(main())
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/cli/main.py", line 150, in main
    return conda_exception_handler(_main, *args, **kwargs)
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1354, in conda_exception_handler
    return_value = exception_handler(func, *args, **kwargs)
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1065, in __call__
    return self.handle_exception(exc_val, exc_tb)
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1109, in handle_exception
    return self.handle_unexpected_exception(exc_val, exc_tb)
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1120, in handle_unexpected_exception
    self.print_unexpected_error_report(error_report)
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1190, in print_unexpected_error_report
    from .cli.main_info import get_env_vars_str, get_main_info_str
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/cli/main_info.py", line 19, in <module>
    from ..core.index import _supplement_index_with_system
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/core/index.py", line 9, in <module>
    from .package_cache_data import PackageCacheData
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/core/package_cache_data.py", line 17, in <module>
    from .path_actions import CacheUrlAction, ExtractPackageAction
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/core/path_actions.py", line 30, in <module>
    from ..gateways.connection.download import download
  File "/home/phil/anaconda3/lib/python3.7/site-packages/conda/gateways/connection/__init__.py", line 38, in <module>
    from pip._vendor.requests import ConnectionError, HTTPError, Session
ModuleNotFoundError: No module named 'pip._vendor'

Caution for Python 2.x user: if you will try to update conda, it is highly likely that it will update Python 2.7 to Python 3.x. So, check for following like like line before your proceed:

  python                pkgs/main::python-2.7.15-h9bab390_6 --> conda-forge::python-3.7.3-
h33d41f4_1

To avoid it, use the following command:
conda install conda python=2.7

I had the same issue. Solved with the help of this article. Saved all the previous environments. Hope it helps others too!!

This one worked for me
conda update -n base -c defaults conda --force
(I tried everything proposed here before)

This one worked for me
conda update -n base -c defaults conda --force
(I tried everything proposed here before)

worked for me after tried all others
conda update -n base -c defaults conda --force

The only thing that worked for me to update a fresh miniconda install was:

conda update -y -n base conda setuptools

Otherwise it would always remove but not reinstall setuptool in the package plan.

To solve this problem
Try This:

  1. conda update conda (if fail)
  2. conda update --force conda (if fail)
    This will work for sure 💯
  3. conda update anaconda-navigator (This worked for me).

If conda update conda or conda update --force conda don't work for you (which is my case), try to install a clean conda package.

Steps:

  1. go to miniconda page: https://conda.io/en/latest/miniconda.html
  2. select the right installer, download, install
  3. it will ask you if you want to initialize conda environment, select yes
  4. then create a new environment should work fine

conda update --force conda
works for me after try almost all commands above
but I am not sure whether other issues will occur

I had the same problem with setuptools while installing pylint. I could fix it while using a combination of a couple of suggestions from here. This is what I did:

  • (my environment) pip uninstall setuptools
  • if setuptools installed in base: (base) pip uninstall setuptools
  • (base) conda install -c anaconda setuptools
  • (base) conda update --force conda
  • (my environment) conda install -c anaconda setuptools
  • (my environment) conda install -c anaconda pylint

Thanks @TobiWo this has worked for me too. Great answer instad of just writing

conda update conda worked for me

keep on going.

Doing 'conda update conda' before it worked for me
conda version : 4.6.2

Thanks, it also worked for me

This worked for me (conda update conda did not - same error):
conda update -n base -c defaults conda --force
And I was dismayed to see:

WARNING: The --force flag will be removed in a future conda release.
         See 'conda update --help' for details about the --force-reinstall
         and --clobber flags.

since adding --force seems to be the only thing that works. Maybe future versions won't have this issue?

I had been seeing this suggestion when I had tried conda update conda:

==> WARNING: A newer version of conda exists. <==
  current version: 4.7.11
  latest version: 4.7.12

Please update conda by running

    $ conda update -n base conda

But the suggestion there resulted in the same error as well.

conda update -n base -c defaults conda --force

appears to work for me too

sudo conda update -n base -c defaults conda --force

After trying everything at last the above command worked

sudo conda update -n base -c defaults conda --force

DO NOT RUN THIS! You will install python 3.8 and can destroy everything!

also using sudo will ruin things because you might be forced to do sudo pip install every time you install anything in the future

sudo conda update -n base -c defaults conda --force

DO NOT RUN THIS! You will install python 3.8 and can destroy everything!

also using sudo will ruin things because you might be forced to do sudo pip install every time you install anything in the future

@veqtor I ran the following set of commands:

  1. I made sure that my environment was conda base
  2. sudo conda update -n base -c defaults conda --force
  3. conda update --all
  4. conda clean --all
  5. python --version

my python version is still Python 3.7.3

After your comment to check if everything is alright I tried to install the library called modin and by just doing pip install modin it worked.

Long story short my experience is different than what you are recommending. Therefore all the folks out there if you are trying my fix, DO IT AT YOUR OWN RISK.

I think all @veqtor means is, don't put sudo in front of the command. It's unnecessary (assuming you haven't already set things up in the past using sudo). I ran the same command without sudo and it worked - and it was the only thing that worked which has been suggested in this thread.

@hepcat72 I can see his point of not running the command with sudo. However, in my case, if I execute it without adding sudo then It was giving the same error as mentioned in the title.

I'm not a conda expert, but I suspect something else is going on with your environment, such as having used sudo in the past for other conda config/installs, making sudo necessary now.

I fixed the sudo-caused mess by chmoding my anaconda files to set write privileges for my user.
"sudo conda update -n base -c defaults conda --force" also ended up installing python 3.8 (breaking a lot of other stuff) but somehow fixed not being able to install the package I needed, I reinstalled python 3.6 using conda install and that restored it.

Run the below command in Anaconda Prompt (Run as administrator)..it worked for me. This command will resolve above conflict of verification failed.. And afterwards you can install whichever package you wish. I have received above error when I was installing Spacy.

conda update -n base -c defaults conda

If you want to install spacy afterwards use below commands:

Run the below command in Anaconda Prompt (Run as administrator)

conda install -c conda-forge spacy

I solved this problem.
Actually, avoid above all's solution.
I tried to all method on solutions but not working.

This is finally choice.
Just reinstall anaconda.
I did reinstall anaconda and it works well right now.

ps. There is a point where it is assumed to be a problem.
It is thought that the problem of path part occurred by repeating the pipe installation not only in the duplication of path setting of python and conda and virtual environment but also in non-virtual environment.

It takes a lot of effort to modify this pass setting, and I hope to find peace through re-installation unless I have a lot of time.

just you need to make an update to you coda,first:
1/open your anaconda prompt.
2/write this line of command: conda update conda
3/press enter

and the problem should be done "ان شاء الله"

thank you.

Having the same issue while Installing keras. I'll try @rocknamx8 solution and see if it works.

But it doesn't work.

@alekhka thank u very much

This one worked for me
conda update -n base -c defaults conda --force
(I tried everything proposed here before)

worked for me after tried all others
conda update -n base -c defaults conda --force

It worked for me.

In the end , "conda update anaconda-navigator" worked for me,
but "conda update conda" didn't.

conda update -n base -c defaults conda --force

appears to work for me too

Worked for me as well (running Linux Mint on AMD).
Cheers!

@alekhka's solution worked for me.

sudo conda update -n base -c defaults conda --force

After trying everything at last the above command worked

worked for me.

it will not update Python to 3.8 because it uses the "defaults" channels.

wow @alekhka , thank you so much

conda update -n base -c defaults conda --force

worked for me.

None of the above worked for me but this did:
conda uninstall setuptools
conda update --force conda
conda install setuptools

conda update --force --all worked for me.

I got similar RemoveError: 'conda_package_handling' is a dependency of conda and cannot be removed ... .
It happen during "conda update --all". Error reported immediately after prompt to update 'conda_package_handling'. I did fix it somehow using: 'conda update conda --force-reinstall'. I have: conda version : 4.8.3, conda-build version : 3.18.11, python version : 3.7.7.final.0

_Also I did scan metadata for package version mismatches and I found something suspicious: different versions in Anaconda metadata for the same package and all of them from Anaconda and 'conda-package-handling' is there. Maybe it is not a problem, but it looks suspicious..._

d:\My\ProPy>py pico\metascan.py -p
Act: d:\InstSoft\Python\Conda3x64\condabin\conda.bat activate
Run: d:\InstSoft\Python\Conda3x64\Python.exe
Arg: pico\metascan.py -p
 --- Scan metadata for version mismatch ---
Prefix: d:\InstSoft\Python\Conda3x64
LibSP : d:\InstSoft\Python\Conda3x64\Lib\site-packages
conda-meta : d:\InstSoft\Python\Conda3x64\conda-meta
pkgs  : d:\InstSoft\Python\Conda3x64\pkgs
Version Mix:
  ['anaconda_project', '0.8.3', 'dist-info', 'LibSP']
  ['anaconda-project', '0.8.4', 'py_0', 'conda-meta']
  ['anaconda-project', '0.8.4', 'py_0', 'pkgs']
Version Mix:
  ['conda_package_handling', '1.7.0', 'dist-info', 'LibSP']
  ['conda-package-handling', '1.6.1', 'py37h62dcd97_0', 'conda-meta']
  ['conda-package-handling', '1.6.1', 'py37h62dcd97_0', 'pkgs']
Version Mix:
  ['setuptools', '46.4.0.post20200518', 'py3.7', 'egg-info', 'LibSP']
  ['setuptools', '46.4.0', 'py37_0', 'conda-meta']
  ['setuptools', '46.4.0', 'py37_0', 'pkgs']
Version mix in metadata for 3 package(s)
d:\My\ProPy>

Doing 'conda update --force conda' worked for me

This worked for me.

it was really frustrating to spend the whole day trying to fix this. I've tried all the solutions posted above but no one worked.
IMHO: Give it a try to a few solutions but if they don't work... face it, reinstall Anaconda

I found an alternative way to overcome this problem without declaring conda bankruptcy (something I've done several times in the past...)

The cause of this issue was that I'd for some reason removed requests and installed it with pip. This jammed up a lot of conda commands because it wanted to replace requests with the one from the conda-forge channel, but couldn't remove it since it raised a RemoveError. I tracked the error down with grep -RI RemoveError $CONDA_PREFIX/lib/, opened the file ($CONDA_PREFIX/lib/python3.7/site-packages/conda/core/link.py), and manually suppressed the error by commenting it out and replacing it with pass. After reinstalling requests with conda install -c conda-forge requests, I undid my changes and everything was fine.

As an aside, I'd recommend adding a warning to novices not to use the base env for anything. Most of my conda troubles have come from ignoring this; it's often uniquely hard to fix things in base, and it can't easily be cloned or nuked and redone without totally starting afresh.

and manually suppressed the error by commenting it out and replacing it with pass

Where did you insert passand what exactly did you comment out?

Where did you insert passand what exactly did you comment out?

Yes, sorry. Here's the change. Original:
$CONDA_PREFIX/lib/python3.7/site-packages/conda/core/link.py line 548

        if conda_final_prefix in prefix_setups:
            for conda_dependency in conda_linked_depends:
                dep_name = MatchSpec(conda_dependency).name
                if dep_name not in pkg_names_being_lnkd and (
                        dep_name not in pkg_names_already_lnkd or
                        dep_name in pkg_names_being_unlnkd):
                    yield RemoveError("'%s' is a dependency of conda and cannot be removed from\n"
                                      "conda's operating environment." % dep_name)

and I changed it to:

        if conda_final_prefix in prefix_setups:
            for conda_dependency in conda_linked_depends:
                dep_name = MatchSpec(conda_dependency).name
                if dep_name not in pkg_names_being_lnkd and (
                        dep_name not in pkg_names_already_lnkd or
                        dep_name in pkg_names_being_unlnkd):
                    pass
     dep_name in pkg_names_being_unlnkd):
                pass

Thanks had to remember the spacing.

Unfortunately I'm still getting:

The following packages are causing the inconsistency:

  - defaults/linux-64::anaconda==2019.07=py37_0  

Any fix for that?

Can you share the rest of the error message?

Can you share the rest of the error message?

conda update anaconda
Collecting package metadata (current_repodata.json): done
Solving environment: -
Found conflicts! Looking for incompatible packages.                                                                         failed with repodata from current_repodata.json, will retry with next repodata source.
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.                                                                      failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: \
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:

  - defaults/linux-64::anaconda==2019.07=py37_0                                                                             done

## Package Plan ##

  environment location: /usr/local/bin/anaconda3

  added / updated specs:
    - anaconda

This time in ran successfully however it ended with this:

The following packages will be DOWNGRADED:

  anaconda                                   2019.07-py37_0 --> custom-py37_1
  lzo                                       2.10-h49e0be7_2 --> 2.10-h7b6447c_2
  pycosat                              0.6.3-py37h14c3975_0 --> 0.6.3-py37h7b6447c_0

So I have:

conda -V
conda 4.8.4
python -V
Python 3.7.3

At least pip/pip3 aren't broken any more. But my goal is to update conda and get Python upgrade to 3.8.

Side note:

pipconflictchecker
--------------------------------------------------
 Conflicts Detected
--------------------------------------------------
 - docutils(0.16) botocore(>=0.10,<0.15)

I wouldn't try to upgrade the Python version in an existing virtual env, especially not base. Easier to create a new one with conda create --name py38 python=3.8, no?

Easier to create a new one with conda create --name py38 python=3.8, no?

OK like mentioned here,

What brought this up was trying to get ROS (robotics OS) to run on Fedora and having the colcon build command fail when running into the old libssh/OpenSSL libraries and getting a slew of undefined references..

So once I active Python 3.8, I'm hoping this should be fixed?

Yikes. Probably not! I don't know much about any of that stuff but I doubt which conda virtualenv you're in affects it. You could try to conda remove libuuid but I'd guess it happens higher up, with your shell's environment variables. Also we're pretty far off topic here so I'd suggest continuing this discussion on a more relevant thread...

Tried conda update --force conda and did not work... furthermore was unable to try any other proposed fixes and am now having to reinstall anaconda.

conda deactivate
conda update --force conda

This worked for me.

Tried conda deactivate and conda update --force conda and did not work... furthermore was unable to try any other proposed fixes and am now having to reinstall anaconda. And also note, every try took a couple of hours

I had this when trying to conda install nltk

conda update conda ran but did not solve the issue

I 'solved' it by using pip install nltk

I've been using miniconda.

I was trying to update my (8 mo. old) miniconda3 installation, and ended up tried just about everything, except hacking/editing code (already a bad idea), and nothing worked, except for the following.

3 hours later:

# Remove index cache, lock files, unused cache packages, and tarballs.
conda clean -a -vv
conda deactivate

#--------------------------------------------------------
# Fixing the conda update problem
#--------------------------------------------------------
# -c CHANNEL
#   Additional channel to search for packages. These are
#   URLs searched in the order they are given (including
#   file:// for local directories). Then, the defaults or
#   channels from .condarc are searched (unless
#   --override-channels is given). You can use 'defaults'
#   to get the default packages for conda. You can also
#   use any name and the .condarc channel_alias value will
#   be prepended. The default channel_alias is
#   http://conda.anaconda.org/.
# 
# -n ENVIRONMENT
#--------------------------------------------------------
conda update -y -n base -c defaults conda --force
conda activate
conda update -y --force conda

pip list -o

# This will still show these as outdated but OK..
#------------------------------------------------
# Package     Version             Latest  Type
# ----------- ------------------- ------- -----
# ruamel-yaml 0.15.87             0.16.12 wheel
# setuptools  49.6.0.post20200814 50.3.0  wheel
#------------------------------------------------

pip install -U setuptools
conda deactivate

# Remove any files related to "ruamel-yaml":
# WARNING: Recursive removal, so don't fuck this up!
cd $env:_CONDA_ROOT
gci -r -fi "ruamel*" | ForEach-Object { rm -Recurse -Force $_ }

#---------------------------------------------------------------------
# IMPORTANT! 
# Now when conda doesn't work, it does something to the environment 
# variables, or perhaps simply kicks you out of the (base).
# In my case it ended up switching the python/pip interpreter, because 
# I have 2 installed. Make sure you're on your original one. 
# In my case it was 3.7, so I had to check it is using the right pip
# version and it's on the right path.
#---------------------------------------------------------------------
pip3.7 -V
# Correct output should be:
# pip 20.2.3 from c:\users\<username>\miniconda3\lib\site-packages\pip (python 3.7)

pip3.7.exe install ruamel-yaml
conda activate
# ok

ALL GOOD!
:champagne: :heart:

conda update --force-reinstall conda worked for me

conda update --force-reinstall conda

Thank You, I was struggling for days. . . . . . jus your line made it easy, now everything got updated and working fine . . . : )

@bounlu
@naveensk23

Perhaps you can tell us why this is better or how it's different from just removing conda and re-installing it?

I was afraid of losing all the environments which I have been worked for the last year, So I really tried my best not to uninstall the anaconda and I wanted to retain all the Env. I tried various options to remove the dependency error.. . Nothing actually worked. At last conda update --force-reinstall conda did work and I was able to retain all my previous conda Env s. now everything working absolutely fine . . . . .

@matthiastns Doing 'conda update --force conda' worked for me

works well for me, too. Thanks.

To update from 4.8.5 I had to do both:

conda update --force-reinstall conda
conda update -n base -c defaults conda
Was this page helpful?
0 / 5 - 0 ratings