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

喜你入骨 提交于 2020-12-28 10:01:20

问题


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


回答1:


running conda update conda before solved the problem for me




回答2:


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




回答3:


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.




回答4:


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.




回答5:


conda update --force conda

this worked for me in win64 when I

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



回答6:


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 : 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.




回答7:


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.




回答8:


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:

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



回答9:


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.




回答10:


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




回答11:


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



来源:https://stackoverflow.com/questions/54392995/removeerror-requests-is-a-dependency-of-conda-and-cannot-be-removed-from-cond

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