Minconda - setuptools problem

Hi, I have run into conda updating problems on several machines. I receive this error (I am using Ubuntu Linux LTS 22.04 on all of them):

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

While researching this I came across the SO discussion
python - RemoveError: 'setuptools' is a dependency of conda and cannot be removed from conda's operating environment - Stack Overflow .

Still, after uninstalling setuptools and attempting to re-install, I get back the RemoveError.

Is there a way to fix this without uninstalling miniconda and reinstalling it? If that is needed, what backups are needed?

Good morning,

Thank you so much for contacting us, could you specify when are you seeing that error?

If you are seeing it each time you try to upgrade please try this command instead:

conda update -n base conda

Let us know if that worked for you.

Thanks, Carlos,
here is the error re-produced just now (attempting to update Jupyter Lab):
(base) marc@marc-Alpha-17-B5EEK:~$ conda update jupyterlab
Collecting package metadata (current_repodata.json): done
Solving environment: \
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:

  • defaults/noarch::argon2-cffi==21.3.0=pyhd3eb1b0_0
  • defaults/linux-64::jupyterlab==3.5.3=py310h06a4308_0
  • defaults/linux-64::psutil==5.9.0=py310h5eee18b_0
  • defaults/noarch::threadpoolctl==2.2.0=pyh0d69192_0
  • defaults/linux-64::pyyaml==6.0=py310h5eee18b_1
  • defaults/noarch::pandocfilters==1.5.0=pyhd3eb1b0_0
  • defaults/linux-64::colorama==0.4.6=py310h06a4308_0
  • defaults/noarch::jaraco.classes==3.2.1=pyhd3eb1b0_0
  • defaults/linux-64::spyder-kernels==2.4.2=py310h06a4308_0
  • defaults/noarch::ipython_genutils==0.2.0=pyhd3eb1b0_1
  • defaults/noarch::pure_eval==0.2.2=pyhd3eb1b0_0
  • defaults/linux-64::mistune==0.8.4=py310h7f8727e_1000
  • conda-forge/linux-64::frozendict==2.3.4=py310h5764c6d_0
  • defaults/linux-64::pyqtwebengine==5.15.7=py310h6a678d5_1
  • defaults/linux-64::kiwisolver==1.4.4=py310h6a678d5_0
  • defaults/linux-64::pylint==2.16.2=py310h06a4308_0
  • defaults/linux-64::pathspec==0.10.3=py310h06a4308_0
  • defaults/linux-64::soupsieve==2.4=py310h06a4308_0
  • defaults/noarch::sphinxcontrib-serializinghtml==1.1.5=pyhd3eb1b0_0
  • defaults/linux-64::requests==2.28.1=py310h06a4308_1
  • defaults/noarch::sphinxcontrib-qthelp==1.0.3=pyhd3eb1b0_0
  • defaults/noarch::appdirs==1.4.4=pyhd3eb1b0_0
  • defaults/linux-64::terminado==0.17.1=py310h06a4308_0
  • defaults/linux-64::lazy-object-proxy==1.6.0=py310h7f8727e_0
  • defaults/noarch::sortedcontainers==2.4.0=pyhd3eb1b0_0
  • defaults/linux-64::bottleneck==1.3.5=py310ha9d4c09_0
  • defaults/linux-64::zipp==3.11.0=py310h06a4308_0
  • defaults/linux-64::markupsafe==2.1.1=py310h7f8727e_0
  • defaults/linux-64::websocket-client==0.58.0=py310h06a4308_4
  • defaults/noarch::pooch==1.4.0=pyhd3eb1b0_0
  • defaults/linux-64::pyqt==5.15.7=py310h6a678d5_1
  • defaults/linux-64::platformdirs==2.5.2=py310h06a4308_0
  • defaults/linux-64::scikit-learn==1.1.3=py310h6a678d5_0
  • defaults/linux-64::pyflakes==3.0.1=py310h06a4308_0
  • defaults/linux-64::boltons==23.0.0=py310h06a4308_0
  • defaults/linux-64::flit-core==3.8.0=py310h06a4308_0
  • defaults/linux-64::qstylizer==0.2.2=py310h06a4308_0
  • defaults/linux-64::wheel==0.38.4=py310h06a4308_0
  • defaults/noarch::backcall==0.2.0=pyhd3eb1b0_0
  • defaults/linux-64::imagesize==1.4.1=py310h06a4308_0
  • defaults/linux-64::qtpy==2.2.0=py310h06a4308_0
  • defaults/linux-64::idna==3.4=py310h06a4308_0
  • defaults/noarch::executing==0.8.3=pyhd3eb1b0_0
  • defaults/linux-64::jedi==0.18.1=py310h06a4308_1
  • defaults/linux-64::wrapt==1.14.1=py310h5eee18b_0
  • defaults/linux-64::python-lsp-black==1.2.1=py310h06a4308_0
  • defaults/linux-64::pydocstyle==6.3.0=py310h06a4308_0
  • defaults/linux-64::pycosat==0.6.4=py310h5eee18b_0
  • defaults/linux-64::notebook-shim==0.2.2=py310h06a4308_0
  • defaults/linux-64::zstandard==0.19.0=py310h5eee18b_0
  • defaults/linux-64::tqdm==4.65.0=py310h2f386ee_0
  • defaults/noarch::binaryornot==0.4.4=pyhd3eb1b0_1
  • defaults/linux-64::contourpy==1.0.5=py310hdb19cb5_0
  • defaults/linux-64::packaging==23.0=py310h06a4308_0
  • defaults/linux-64::importlib-metadata==6.0.0=py310h06a4308_0
  • defaults/linux-64::typing_extensions==4.4.0=py310h06a4308_0
  • defaults/linux-64::jellyfish==0.9.0=py310h7f8727e_0
  • defaults/noarch::parso==0.8.3=pyhd3eb1b0_0
  • defaults/linux-64::prompt-toolkit==3.0.36=py310h06a4308_0
  • defaults/noarch::decorator==5.1.1=pyhd3eb1b0_0
  • defaults/linux-64::typing-extensions==4.4.0=py310h06a4308_0
  • defaults/linux-64::python-fastjsonschema==2.16.2=py310h06a4308_0
  • defaults/linux-64::tinycss2==1.2.1=py310h06a4308_0
  • defaults/linux-64::babel==2.11.0=py310h06a4308_0
  • defaults/linux-64::mkl_random==1.2.2=py310h00e6091_0
  • defaults/linux-64::pluggy==1.0.0=py310h06a4308_1
  • defaults/linux-64::anyio==3.5.0=py310h06a4308_0
  • defaults/linux-64::pyrsistent==0.18.0=py310h7f8727e_0
  • defaults/noarch::python-dateutil==2.8.2=pyhd3eb1b0_0
  • defaults/linux-64::xyzservices==2022.9.0=py310h06a4308_1
  • defaults/linux-64::matplotlib==3.6.2=py310h06a4308_0
  • defaults/noarch::sphinxcontrib-applehelp==1.0.2=pyhd3eb1b0_0
  • defaults/linux-64::numpydoc==1.5.0=py310h06a4308_0
  • defaults/linux-64::qtconsole==5.4.0=py310h06a4308_0
  • defaults/linux-64::ipykernel==6.19.2=py310h2f386ee_0
  • defaults/linux-64::nbconvert==6.5.4=py310h06a4308_0
  • defaults/linux-64::matplotlib-base==3.6.2=py310h945d387_0
  • defaults/linux-64::ruamel.yaml.clib==0.2.6=py310h5eee18b_1
  • defaults/linux-64::mkl_fft==1.3.1=py310hd6ae3a3_0
  • defaults/linux-64::chardet==4.0.0=py310h06a4308_1003
  • defaults/noarch::pexpect==4.8.0=pyhd3eb1b0_3
  • defaults/noarch::jeepney==0.7.1=pyhd3eb1b0_0
  • defaults/linux-64::dill==0.3.6=py310h06a4308_0
  • defaults/linux-64::mypy_extensions==0.4.3=py310h06a4308_0
  • defaults/linux-64::mkl-service==2.4.0=py310h7f8727e_0
  • defaults/noarch::six==1.16.0=pyhd3eb1b0_1
  • defaults/linux-64::conda==23.3.1=py310h06a4308_0
  • defaults/noarch::autopep8==1.6.0=pyhd3eb1b0_1
  • defaults/noarch::bleach==4.1.0=pyhd3eb1b0_0
  • defaults/linux-64::python==3.10.10=h7a1cb2a_2
  • defaults/noarch::jupyterlab_pygments==0.1.2=py_0
  • defaults/noarch::munkres==1.1.4=py_0
  • defaults/noarch::pyls-spyder==0.4.0=pyhd3eb1b0_0
  • defaults/linux-64::nbclassic==0.5.4=py310h06a4308_0
  • defaults/noarch::python-slugify==5.0.2=pyhd3eb1b0_0
  • defaults/linux-64::click==8.0.4=py310h06a4308_0
  • defaults/noarch::defusedxml==0.7.1=pyhd3eb1b0_0
  • defaults/linux-64::docstring-to-markdown==0.11=py310h06a4308_0
  • defaults/noarch::three-merge==0.1.1=pyhd3eb1b0_0
  • defaults/linux-64::cryptography==39.0.1=py310h9ce1e76_0
  • defaults/linux-64::tomli==2.0.1=py310h06a4308_0
  • defaults/noarch::text-unidecode==1.3=pyhd3eb1b0_0
  • defaults/noarch::unidecode==1.2.0=pyhd3eb1b0_0
  • defaults/noarch::cookiecutter==1.7.3=pyhd3eb1b0_0
  • defaults/noarch::python-lsp-jsonrpc==1.0.0=pyhd3eb1b0_0
  • defaults/noarch::atomicwrites==1.4.0=py_0
  • defaults/linux-64::brotlipy==0.7.0=py310h7f8727e_1002
  • defaults/linux-64::attrs==22.1.0=py310h06a4308_0
  • defaults/noarch::intervaltree==3.1.0=pyhd3eb1b0_0
  • defaults/linux-64::pytz==2022.7=py310h06a4308_0
  • defaults/noarch::pycparser==2.21=pyhd3eb1b0_0
  • defaults/linux-64::nest-asyncio==1.5.6=py310h06a4308_0
  • defaults/linux-64::pip==23.0.1=py310h06a4308_0
  • defaults/linux-64::webencodings==0.5.1=py310h06a4308_1
  • defaults/noarch::cycler==0.11.0=pyhd3eb1b0_0
  • defaults/linux-64::jupyterlab_server==2.22.0=py310h06a4308_0
  • defaults/linux-64::seaborn==0.12.2=py310h06a4308_0
  • defaults/noarch::yapf==0.31.0=pyhd3eb1b0_0
  • defaults/linux-64::ply==3.11=py310h06a4308_0
  • defaults/linux-64::keyring==23.13.1=py310h06a4308_0
  • defaults/linux-64::ruamel.yaml==0.17.21=py310h5eee18b_0
  • defaults/linux-64::pillow==9.4.0=py310h6a678d5_0
  • defaults/linux-64::comm==0.1.2=py310h06a4308_0
  • defaults/noarch::jinja2-time==0.2.0=pyhd3eb1b0_3
  • defaults/noarch::pickleshare==0.7.5=pyhd3eb1b0_1003
  • defaults/linux-64::numpy==1.23.5=py310hd5efca6_0
  • defaults/linux-64::nbformat==5.7.0=py310h06a4308_0
  • defaults/linux-64::jinja2==3.1.2=py310h06a4308_0
  • defaults/linux-64::bokeh==3.1.0=py310h2f386ee_0
  • defaults/linux-64::arrow==1.2.3=py310h06a4308_1
  • defaults/linux-64::cffi==1.15.1=py310h5eee18b_3
  • defaults/linux-64::spyder==5.4.2=py310h06a4308_0
  • defaults/linux-64::pytoolconfig==1.2.5=py310h06a4308_1
  • defaults/noarch::wcwidth==0.2.5=pyhd3eb1b0_0
  • defaults/linux-64::qtawesome==1.2.2=py310h06a4308_0
  • defaults/noarch::importlib_metadata==6.0.0=hd3eb1b0_0
  • defaults/linux-64::ipython==8.12.0=py310h06a4308_0
  • defaults/linux-64::docutils==0.18.1=py310h06a4308_3
  • defaults/noarch::qdarkstyle==3.0.2=pyhd3eb1b0_0
  • defaults/noarch::poyo==0.5.0=pyhd3eb1b0_0
  • defaults/linux-64::traitlets==5.7.1=py310h06a4308_0
  • defaults/linux-64::pyzmq==23.2.0=py310h6a678d5_0
  • defaults/noarch::asttokens==2.0.5=pyhd3eb1b0_0
  • defaults/linux-64::toolz==0.12.0=py310h06a4308_0
  • defaults/linux-64::prometheus_client==0.14.1=py310h06a4308_0
  • defaults/noarch::json5==0.9.6=pyhd3eb1b0_0
  • defaults/noarch::toml==0.10.2=pyhd3eb1b0_0
  • defaults/linux-64::pyopenssl==23.0.0=py310h06a4308_0
  • conda-forge/linux-64::wordcloud==1.8.2.2=py310h5764c6d_1
  • defaults/noarch::diff-match-patch==20200713=pyhd3eb1b0_0
  • defaults/linux-64::joblib==1.1.1=py310h06a4308_0
  • defaults/linux-64::secretstorage==3.3.1=py310h06a4308_1
  • defaults/noarch::alabaster==0.7.12=pyhd3eb1b0_0
  • defaults/linux-64::sphinx==5.0.2=py310h06a4308_0
  • defaults/noarch::jsonpointer==2.1=pyhd3eb1b0_0
  • defaults/linux-64::conda-package-streaming==0.7.0=py310h06a4308_0
  • defaults/linux-64::pyparsing==3.0.9=py310h06a4308_0
  • defaults/noarch::pygments==2.11.2=pyhd3eb1b0_0
  • defaults/linux-64::flake8==6.0.0=py310h06a4308_0
  • defaults/linux-64::jupyter_core==5.3.0=py310h06a4308_0
  • defaults/noarch::sphinxcontrib-devhelp==1.0.2=pyhd3eb1b0_0
  • conda-forge/noarch::numpy-financial==1.0.0=pyhd8ed1ab_0
  • conda-forge/linux-64::python_abi==3.10=2_cp310
  • defaults/noarch::sphinxcontrib-jsmath==1.0.1=pyhd3eb1b0_0
  • defaults/linux-64::scipy==1.10.1=py310hd5efca6_0
  • defaults/linux-64::tomlkit==0.11.1=py310h06a4308_0
  • defaults/noarch::fonttools==4.25.0=pyhd3eb1b0_0
  • defaults/linux-64::entrypoints==0.4=py310h06a4308_0
  • defaults/linux-64::conda-package-handling==2.0.2=py310h06a4308_0
  • defaults/linux-64::pysocks==1.7.1=py310h06a4308_0
  • defaults/noarch::textdistance==4.2.1=pyhd3eb1b0_0
  • defaults/noarch::html5lib==1.1=pyhd3eb1b0_0
  • defaults/linux-64::notebook==6.5.3=py310h06a4308_0
  • defaults/linux-64::pycodestyle==2.10.0=py310h06a4308_0
  • defaults/linux-64::sip==6.6.2=py310h6a678d5_0
  • defaults/linux-64::jupyter_server==1.23.4=py310h06a4308_0
  • conda-forge/noarch::multitasking==0.0.9=pyhd8ed1ab_0
  • defaults/linux-64::python-lsp-server==1.7.1=py310h06a4308_0
  • defaults/linux-64::rope==1.7.0=py310h06a4308_0
  • defaults/linux-64::pylint-venv==2.3.0=py310h06a4308_0
  • defaults/noarch::isort==5.9.3=pyhd3eb1b0_0
  • defaults/linux-64::inflection==0.5.1=py310h06a4308_0
  • defaults/noarch::more-itertools==8.12.0=pyhd3eb1b0_0
  • defaults/linux-64::beautifulsoup4==4.12.0=py310h06a4308_0
  • defaults/linux-64::tornado==6.2=py310h5eee18b_0
  • defaults/linux-64::pandas==1.5.3=py310h1128e8f_0
  • defaults/noarch::stack_data==0.2.0=pyhd3eb1b0_0
  • defaults/noarch::snowballstemmer==2.2.0=pyhd3eb1b0_0
  • defaults/linux-64::black==23.3.0=py310h06a4308_0
  • defaults/linux-64::certifi==2022.12.7=py310h06a4308_0
  • defaults/linux-64::sniffio==1.2.0=py310h06a4308_1
  • defaults/linux-64::whatthepatch==1.0.2=py310h06a4308_0
  • defaults/linux-64::ujson==5.4.0=py310h6a678d5_0
  • defaults/noarch::cloudpickle==2.0.0=pyhd3eb1b0_0
  • defaults/linux-64::matplotlib-inline==0.1.6=py310h06a4308_0
  • defaults/linux-64::numexpr==2.8.4=py310h8879344_0
  • defaults/noarch::pyxdg==0.27=pyhd3eb1b0_0
  • defaults/linux-64::debugpy==1.5.1=py310h295c915_0
  • defaults/linux-64::rtree==1.0.1=py310h06a4308_0
  • defaults/noarch::jsonpatch==1.32=pyhd3eb1b0_0
  • defaults/linux-64::nbclient==0.5.13=py310h06a4308_0
  • defaults/linux-64::wurlitzer==3.0.2=py310h06a4308_0
  • defaults/noarch::sphinxcontrib-htmlhelp==2.0.0=pyhd3eb1b0_0
  • defaults/linux-64::argon2-cffi-bindings==21.2.0=py310h7f8727e_0
  • defaults/linux-64::urllib3==1.26.15=py310h06a4308_0
  • defaults/linux-64::astroid==2.14.2=py310h06a4308_0
  • defaults/linux-64::lxml==4.9.2=py310h5eee18b_0
  • defaults/noarch::ptyprocess==0.7.0=pyhd3eb1b0_2
  • defaults/linux-64::pyqt5-sip==12.11.0=py310h6a678d5_1
  • defaults/noarch::send2trash==1.8.0=pyhd3eb1b0_1
    done

==> WARNING: A newer version of conda exists. <==
current version: 23.3.1
latest version: 23.5.0

Please update conda by running

$ conda update -n base -c defaults conda

Or to minimize the number of packages updated during conda update use

 conda install conda=23.5.0

Package Plan

environment location: /home/marc/miniconda3

added / updated specs:
- jupyterlab

The following NEW packages will be INSTALLED:

charset-normalizer pkgs/main/noarch::charset-normalizer-2.0.4-pyhd3eb1b0_0
jsonschema pkgs/main/linux-64::jsonschema-4.17.3-py310h06a4308_0
jupyter_client pkgs/main/linux-64::jupyter_client-7.4.9-py310h06a4308_0
mccabe pkgs/main/noarch::mccabe-0.7.0-pyhd3eb1b0_0
numpy-base pkgs/main/linux-64::numpy-base-1.23.5-py310h8e6c178_0
setuptools pkgs/main/linux-64::setuptools-67.8.0-py310h06a4308_0
watchdog pkgs/main/linux-64::watchdog-2.1.6-py310h06a4308_0

The following packages will be UPDATED:

libffi 3.4.2-h6a678d5_6 → 3.4.4-h6a678d5_0
libllvm14 14.0.6-hdb19cb5_2 → 14.0.6-hdb19cb5_3
nspr 4.33-h295c915_0 → 4.35-h6a678d5_0
nss 3.74-h0370c37_0 → 3.89.1-h6a678d5_0
sqlite 3.41.1-h5eee18b_0 → 3.41.2-h5eee18b_0
xz 5.2.10-h5eee18b_1 → 5.4.2-h5eee18b_0
zstd 1.5.4-hc292b87_0 → 1.5.5-hc292b87_0

Proceed ([y]/n)? y

Downloading and Extracting Packages

Preparing transaction: done
Verifying transaction: failed

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

(base) marc@marc-Alpha-17-B5EEK:~$

I get the same error when executing the code in the Warning, and again when I your command (see picture attached).

Hello,

The dependency problems you are having are a result of having conda-forge packages installed in your ‘base’ environment. conda-forge has bleeding edge packages, whereas the conda packages installed by default in the base environment are stable versions of those packages .

You should install conda-forge packages into a separate conda environment to get avoid this kind of problem:

conda create-n cforgeenv 
conda activate cforgeenv
conda install pyopenssl

(for example)

1 Like

thanks for your help, much appreciated

I have a similar problem but with the ‘tqdm’ package instead of ‘setuptools’.
But how can this issue be resolved?