Search code examples
pythoncondaversion

I stupidly deleted the python folder from /opt/conda/bin/python and can't figure out how to reinstall it or fix conda now?


I removed the python folder from /opt/conda/bin/python and now every time I try to run 'conda activate' I get '/opt/conda/bin/python not found'

I didn't realize this was so important to conda running correctly. I figure because there was a python3 folder as well it would be fine and just wanted to get rid of all the python2.7 stuff off of my computer so my code would run correcly.

Any advice would be greatly appriciated!

Tried to uninstall and reinstall conda and when reinstall got


Failed building wheel for conda Running setup.py clean for conda Failed to build conda


Solution

  • You might be able to repair it with a standalone tool like Micromamba. Something along the following lines might do the trick:

    ## install micromamba
    ## change "bash" to "zsh" if zsh shell
    curl micro.mamba.pm/install.sh | bash
    
    export MAMBA_ROOT_PREFIX=/opt/conda
    
    micromamba install -n base --force-reinstall python
    

    Then try restarting your shell.