0

I accidentally install a lot of packages using pip install -r requirements.txt under base environment. Then I tried to pip uninstall, but it seems that the uninstalling process is unsuccessful.

I am using the miniconda on Windows. How can I recover the base environment to clean state? Or do I have to reinstall miniconda to remove the whole base environment?

1 Answer 1

0

Unlike Conda, Pip doesn't seem to track revisions and Conda doesn't actively track what Pip does (it passively detects installed packages in the lib/python*/site-packages).

One idea around that conundrum might be to export a --from-history YAML:

conda env export -n base --from-history

That will include a section of pip: installed packages and you could use that as the list of packages to remove. It could still be problematic if, for example, Pip installed a newer version of a package from PyPI that is essential for the conda package to function.

If truly broken, you can also restore basic Conda functionality by using a standalone tool like Micromamba. See https://stackoverflow.com/a/75381135/570918, but you'll need to check the docs for Windows installation steps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.