Conda is broken after update: No module named 'conda_package_handling'
After updating my conda version 4.7.5 with
I followed the advice from the GitHub user andystevens91 in this Conda issue thread:
conda update conda
, conda is now broken. I get the following error message when doing conda info
:ModuleNotFoundError: No module named 'conda_package_handling'
- 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:
- Backup your conda environments:
cp -R ~/miniconda3/envs/* /somewhere/else
- Delete the miniconda3 (or anaconda3) folder:
rm -rf ~/miniconda3
- 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/ - In your terminal window, depending on your OS, run the following command:
[if on macOS]bash Miniconda3-latest-MacOSX-x86_64.sh -u
bash Miniconda3-latest-Linux-x86_64.sh -u
- When asked "Do you wish the installer to initialize Miniconda3 by running conda init?", type yes.
- Update conda:
conda update -n base -c defaults conda conda update --all
- Copy back your environments:
cp -R /somewhere/else ~/miniconda3/envs/
- Now, test that your conda installation works:
conda -V conda info
- Test that your copied environments work: so far so good!
Thanks for sharing this.
ReplyDelete