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

PythonWindowsConda

Python Problem Overview


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

C:\Users\XYZ>conda env create -f python3.6-environment-windows.yml
Collecting package metadata: done
Solving environment: done

Downloading and Extracting Packages
certifi-2018.1.18    | 144 KB    | ############################################################################ | 100%
mkl-2018.0.1         | 155.2 MB  | ############################################################################ | 100%
pytz-2018.9          | 229 KB    | ############################################################################ | 100%
icc_rt-2019.0.0      | 9.4 MB    | ############################################################################ | 100%
icu-58.2             | 21.8 MB   | ############################################################################ | 100%
pip-9.0.1            | 1.7 MB    | ############################################################################ | 100%
xz-5.2.3             | 348 KB    | ############################################################################ | 100%
sip-4.18.1           | 269 KB    | ############################################################################ | 100%
libpng-1.6.36        | 1.3 MB    | ############################################################################ | 100%
vc-14                | 985 B     | ############################################################################ | 100%
numpy-1.14.0         | 3.7 MB    | ############################################################################ | 100%
python-3.6.4         | 17.6 MB   | ############################################################################ | 100%
jpeg-9c              | 314 KB    | ############################################################################ | 100%
wheel-0.30.0         | 85 KB     | ############################################################################ | 100%
wincertstore-0.2     | 13 KB     | ############################################################################ | 100%
freetype-2.9.1       | 475 KB    | ############################################################################ | 100%
scipy-1.0.0          | 13.0 MB   | ############################################################################ | 100%
pyparsing-2.3.1      | 54 KB     | ############################################################################ | 100%
kiwisolver-1.0.1     | 60 KB     | ############################################################################ | 100%
qt-5.6.2             | 55.6 MB   | ############################################################################ | 100%
python-dateutil-2.7. | 218 KB    | ############################################################################ | 100%
vs2015_runtime-14.0. | 1.9 MB    | ############################################################################ | 100%
ca-certificates-2017 | 489 KB    | ############################################################################ | 100%
tk-8.6.7             | 3.5 MB    | ############################################################################ | 100%
setuptools-38.4.0    | 540 KB    | ############################################################################ | 100%
matplotlib-2.2.2     | 6.5 MB    | ############################################################################ | 100%
six-1.12.0           | 21 KB     | ############################################################################ | 100%
openssl-1.0.2n       | 5.4 MB    | ############################################################################ | 100%
pyqt-5.6.0           | 4.5 MB    | ############################################################################ | 100%
zlib-1.2.11          | 236 KB    | ############################################################################ | 100%
tornado-5.1.1        | 665 KB    | ############################################################################ | 100%
sqlite-3.22.0        | 907 KB    | ############################################################################ | 100%
cycler-0.10.0        | 8 KB      | ############################################################################ | 100%
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.

In reference to the instructions here - https://enigma.co/catalyst/install.html#installing-with-conda

Python Solutions


Solution 1 - Python

I had the same problem on Mac Mojave, and in my case run conda update --force conda first worked for me.

Solution 2 - Python

running conda update conda before solved the problem for me

Solution 3 - Python

This worked for me on Linux:

  1. Uninstall the package via pip:

     pip uninstall setuptools
    
  2. Reinstall using the following command:

     conda install -c anaconda setuptools
    

Consider also that system packages (python3-setuptools, python-setuptools in Ubuntu) might need to be removed.

Solution 4 - Python

conda update --force conda

will solve : Verifying transaction: failed Remove Error: 'request' is a dependency of conda and cannot be removed from conda is operating environment.

Solution 5 - Python

conda update --force conda

this worked for me in win64 when I

conda install -c https://conda.anaconda.org/sdvillal openslide-python

Solution 6 - Python

Silly point to make here but I've been caught by this before: you may not be in the environment you think you are. Just before killing off any package run a quick check to see:

conda env list

Performing ops on the base environment can cause issues, so you may want to create or change environment.

Solution 7 - Python

I had the same problem, which was due to a bad installation of a package (OpenEXR in my case). Try to verify your package with conda list yourPackage. If you find which one it is, prefer installing it with pre-built packages here : https://www.lfd.uci.edu/~gohlke/pythonlibs/.

A stack-overflow thread that helped me : https://stackoverflow.com/questions/38320033/python-2-7-pip-failed-building-wheel-for

EDIT : Two friends had the same error, one solved it by installing/executing with admin rights. The other one succeeded by creating a new virtual environnement for python.

Solution 8 - Python

I ran into the same problem, on macos, after removing all R packages installed by anaconda. Unfortunately, the only solution I found is to reinstall anaconda. Alternatively, you could download miniconda shell script installer, run it with -U option and point the installer at your conda directory. This fixed the issue for me while maintaining settings such as channel priority. However, many of previously installed packages were not importable (Python couldn't find them) and i ended up re-installing all of them.

Solution 9 - Python

I had the same problem. Try to use the command prompt to install wheel file if you get an error something like this(as shown in picture) then you must install that wheel file:

enter image description here

Extra(how to install wheel file from command prompt):

> - download wheel file as per the system specifications: -search required file here https://www.lfd.uci.edu/~gohlke/pythonlibs/ -e.g. > bsddb3 -click bsddb3 and search required file > - open command prompt on your system > - change the location on the command prompt to: where you have downloaded wheel file e.g C:\Users\Name\Downloads > - go to the location, where you have installed python>>go to script>> copy the path (e.g C:\Program Files (x86)\Python36-32\Scripts) > - write the command, to install wheel file using pip install (e.g. C:\Program Files (x86)\Python36-32\Scripts\pip install > copy_name_of_the_wheel_file) > - run the command

Solution 10 - Python

try conda env create --force -f python3.6-environment-windows.yml I'm not sure exactly where to place it but I use the --force whenever I run into issues like this like conda update --force conda or conda install --force ... use it as last solution since it force conda to perform the command and you might run into some issues later on

Solution 11 - Python

I had solved the problem RemoveError: 'setuptools' is a dependency of conda and cannot be removed from conda's operating environment.

enter image description here

As the following way:

  • pip uninstall setuptools
  • conda update conda
  • conda update setuptools

enter image description here

and then check tools

enter image description here

I haven't met any mistakes yet, but help me correct my way , if something wrong, please

Solution 12 - Python

For me, deactivating the current conda environment solves the problem, i.e. run conda deactivate before upgrading.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGooseView Question on Stackoverflow
Solution 1 - Pythonleon youngView Answer on Stackoverflow
Solution 2 - PythonYonGUView Answer on Stackoverflow
Solution 3 - PythonSaeedMView Answer on Stackoverflow
Solution 4 - PythonPriceless wordsView Answer on Stackoverflow
Solution 5 - PythonlongerkingView Answer on Stackoverflow
Solution 6 - PythonRalph CowlingView Answer on Stackoverflow
Solution 7 - PythonPaul-Elie PipelinView Answer on Stackoverflow
Solution 8 - PythonPiotr DworzynskiView Answer on Stackoverflow
Solution 9 - Pythonpankaj bhagchandaniView Answer on Stackoverflow
Solution 10 - Pythonamine sachiroView Answer on Stackoverflow
Solution 11 - PythonMathews MingView Answer on Stackoverflow
Solution 12 - PythonQinjieView Answer on Stackoverflow