Conda更新之后出现No module named ‘libarchive’

(base) MacBook-Pro:downloads name$ conda install -c bioconda cwltool
Traceback (most recent call last):
  File "/Users/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1043, in __call__
    return func(*args, **kwargs)
  File "/Users/anaconda3/lib/python3.7/site-packages/conda/cli/main.py", line 84, in _main
    exit_code = do_call(args, p)
  File "/Users/anaconda3/lib/python3.7/site-packages/conda/cli/conda_argparse.py", line 80, in do_call
    module = import_module(relative_mod, __name__.rsplit('.', 1)[0])
  File "/Users/anaconda3/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1006, in _gcd_import
  File "", line 983, in _find_and_load
  File "", line 967, in _find_and_load_unlocked
  File "", line 677, in _load_unlocked
  File "", line 728, in exec_module
  File "", line 219, in _call_with_frames_removed
  File "/Users/anaconda3/lib/python3.7/site-packages/conda/cli/main_install.py", line 8, in <module>
    from .install import install
  File "/Users/anaconda3/lib/python3.7/site-packages/conda/cli/install.py", line 19, in <module>
    from ..core.index import calculate_channel_urls, get_index
  File "/Users/anaconda3/lib/python3.7/site-packages/conda/core/index.py", line 9, in <module>
    from .package_cache_data import PackageCacheData
  File "/Users/anaconda3/lib/python3.7/site-packages/conda/core/package_cache_data.py", line 15, in <module>
    from conda_package_handling.api import InvalidArchiveError
  File "/Users/anaconda3/lib/python3.7/site-packages/conda_package_handling/api.py", line 3, in <module>
    from libarchive.exception import ArchiveError as _LibarchiveArchiveError
ModuleNotFoundError: No module named 'libarchive'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/anaconda3/bin/conda", line 13, in <module>
    sys.exit(main())
  File "/Users/anaconda3/lib/python3.7/site-packages/conda/cli/main.py", line 150, in main
    return conda_exception_handler(_main, *args, **kwargs)
  File "/Users/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1335, in conda_exception_handler
    return_value = exception_handler(func, *args, **kwargs)
  File "/Users/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1046, in __call__
    return self.handle_exception(exc_val, exc_tb)
  File "/Users/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1090, in handle_exception
    return self.handle_unexpected_exception(exc_val, exc_tb)
  File "/Users/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1101, in handle_unexpected_exception
    self.print_unexpected_error_report(error_report)
  File "/Users/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1171, in print_unexpected_error_report
    from .cli.main_info import get_env_vars_str, get_main_info_str
  File "/Users/anaconda3/lib/python3.7/site-packages/conda/cli/main_info.py", line 19, in <module>
    from ..core.index import _supplement_index_with_system
  File "/Users/anaconda3/lib/python3.7/site-packages/conda/core/index.py", line 9, in <module>
    from .package_cache_data import PackageCacheData
  File "/Users/anaconda3/lib/python3.7/site-packages/conda/core/package_cache_data.py", line 15, in <module>
    from conda_package_handling.api import InvalidArchiveError
  File "/Users/anaconda3/lib/python3.7/site-packages/conda_package_handling/api.py", line 3, in <module>
    from libarchive.exception import ArchiveError as _LibarchiveArchiveError
ModuleNotFoundError: No module named 'libarchive'

非常僵硬,去github上搜到相应解决方案

里面有个方法是这样:

  1. downloaded Miniconda3-latest-Linux-x86_64.sh from https://repo.continuum.io/miniconda/
  2. bash Miniconda3-latest-Linux-x86_64.sh
  3. “Do you wish the installer to initialize Miniconda3 by running conda init?” NO If you choose this, I think the default environment when startup should be in miniconda3 but not the original anaconda3.
  4. cd ~/miniconda3/bin This conda from miniconda3 should work perfectly without bugs.
  5. Use the conda from miniconda3 to ‘heal’ your anaconda3. Like this:
    ./conda install --prefix ~/anaconda3/ ~/anaconda3/pkgs/conda_package_handling_XXX.tar.bz2
    This should allow you to reinstall the packages that are missing in the error output of anaconda3.
    In my case, I reinstall conda_package_handling, requests, and urllib3.
  6. Try your anaconda3 conda using conda info or conda install PACKAGE.
  7. If you can get a normal output from conda info, you should be able to revert to previous version of conda using conda install --revision. Please see: link

但是我到第四步就挂了了,显示如下:

Miniconda3 will now be installed into this location:
/Users/miniconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/Users/miniconda3] >>> 
PREFIX=/Users/miniconda3
Miniconda3-latest-Linux-x86_64.sh: line 328: md5sum: command not found
WARNING: md5sum mismatch of tar archive
expected: 3b03ac60617957c1f3fa27f450db4992
     got: 
reinstalling: python-3.7.3-h0371630_0 ...
Miniconda3-latest-Linux-x86_64.sh: line 370: /Users/miniconda3/pkgs/python-3.7.3-h0371630_0/bin/python: cannot execute binary file

好的,不晓得为啥了,我死了。

你可能感兴趣的:(Linux)