Conda is broken after update: No module named 'conda_package_handling'

After updating my conda version 4.7.5 with conda update conda, conda is now broken. I get the following error message when doing conda info:
ModuleNotFoundError: No module named 'conda_package_handling'
NOTES:
  • I'm working with conda version 4.7.5 and miniconda3
  • After trying to reproduce this bug, I am now getting the following error message when doing conda info:
    OSError: dlopen(/Users/../lib/libarchive.dylib, 6): Library not loaded: @rpath/libxml2.2.dylib
  • EDIT [2019-07-29] : I removed the temporary solution which consisted in downgrading your conda version since I found a complete solution (from a GitHub user) that allows you to work with the latest conda version 4.7.10 and Python 3.7.3 . See the solution below.

Solution: re-install conda completely

WARNING: the following solution involves the copying and deletion of the miniconda3 folder. Therefore, be very careful when handling the shell commands. I am not responsible for any data loss on your part.

I followed the advice from the GitHub user andystevens91 in this Conda issue thread:
  1. Backup your conda environments:
    cp -R ~/miniconda3/envs/* /somewhere/else
    
  2. Delete the miniconda3 (or anaconda3) folder:
    rm -rf ~/miniconda3
    
  3. Download the latest miniconda bash installer from https://repo.continuum.io/miniconda/
    NOTE: If you are working with anaconda, you will get the bash installer from https://repo.continuum.io/archive/
  4. In your terminal window, depending on your OS, run the following command:
    [if on macOS]
    bash Miniconda3-latest-MacOSX-x86_64.sh -u
    [if on Linux]
    bash Miniconda3-latest-Linux-x86_64.sh -u
    
  5. When asked "Do you wish the installer to initialize Miniconda3 by running conda init?", type yes.
  6. Update conda:
    conda update -n base -c defaults conda
    conda update --all
    
  7. Copy back your environments:
    cp -R /somewhere/else ~/miniconda3/envs/
    
  8. Now, test that your conda installation works:
    conda -V
    conda info
  9. Test that your copied environments work: so far so good!
Big thank you to the GitHub user andystevens91 that provided this much-needed solution 👍

Comments

Post a Comment

Popular posts from this blog

Deactivate conda's base environment on startup

Draw arrows with GIMP plugins

Product review: SMONET wireless security camera system