Search code examples
pythonanacondapyopenssl

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


I am trying to install and update packages on Ananconda 3.7 on Windows 10.

When I ran the code:

 conda update --all

or even

 conda install pandas

I got the following error:

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

I am not sure why this is? also not sure if this pyopenssl package should be removed if it is going to help in anyways.


Solution

  • I came up with the same problem today, and the solution is quite simple:

    conda deactivate
    conda install --force-reinstall conda
    

    As the error message says, 'pyopenssl' is a dependency of conda. So I came up with the idea of force reinstalling conda, thus ignoring the dependency loop. And you have to deactivate the env, otherwise conda would complain not able to update itself when virtual env is still active.


    Additional notes in 2023:

    If you happen to see this answer now, I'm strongly recommending trying out mamba, a drop-in replacement of conda written in C++. Just run:

    conda install -n base conda-forge::mamba && mamba init
    

    Reopen your shell and you should be good to go. (zsh users might need to run mamba init zsh manually)

    I am writing this note after conda got OOM killed for installing rstudio-desktop in my Bioconductor environment. Conda is hella slow, especially when compared with mamba.