windows anaconda TypeError: LoadLibrary() argument 1 must be str, not None [Debug]

最新windows conda在运行时会报以下错误:

λ conda info -e

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "D:\ProgramFiles\Anaconda3\lib\site-packages\conda\exceptions.py", line 1062, in __call__
        return func(*args, **kwargs)
      File "D:\ProgramFiles\Anaconda3\lib\site-packages\conda\cli\main.py", line 84, in _main
        exit_code = do_call(args, p)
      File "D:\ProgramFiles\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 80, in do_call
        module = import_module(relative_mod, __name__.rsplit('.', 1)[0])
      File "D:\ProgramFiles\Anaconda3\lib\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 "D:\ProgramFiles\Anaconda3\lib\site-packages\conda\cli\main_info.py", line 19, in
        from ..core.index import _supplement_index_with_system
      File "D:\ProgramFiles\Anaconda3\lib\site-packages\conda\core\index.py", line 9, in
        from .package_cache_data import PackageCacheData
      File "D:\ProgramFiles\Anaconda3\lib\site-packages\conda\core\package_cache_data.py", line 15, in
        from conda_package_handling.api import InvalidArchiveError
      File "D:\ProgramFiles\Anaconda3\lib\site-packages\conda_package_handling\api.py", line 3, in
        from libarchive.exception import ArchiveError as _LibarchiveArchiveError
      File "D:\ProgramFiles\Anaconda3\lib\site-packages\libarchive\__init__.py", line 1, in
        from .entry import ArchiveEntry
      File "D:\ProgramFiles\Anaconda3\lib\site-packages\libarchive\entry.py", line 6, in
        from . import ffi
      File "D:\ProgramFiles\Anaconda3\lib\site-packages\libarchive\ffi.py", line 48, in
        libarchive = ctypes.cdll.LoadLibrary(libarchive_path)
      File "D:\ProgramFiles\Anaconda3\lib\ctypes\__init__.py", line 434, in LoadLibrary
        return self._dlltype(name)
      File "D:\ProgramFiles\Anaconda3\lib\ctypes\__init__.py", line 356, in __init__
        self._handle = _dlopen(self._name, mode)
    TypeError: LoadLibrary() argument 1 must be str, not None

`$ D:\ProgramFiles\Anaconda3\Scripts\conda-script.py info -e`


An unexpected error has occurred. Conda has prepared the above report.

看了一下原因,不知道啥时候最新Anaconda中多了一个folder: E:\ProgramFiles\Anaconda3\condabin\,所以conda.exe需要依赖某些环境变量没有,得按conda.bat来运行。。。

以前Anaconda的系统环境变量中只有:

  • E:\ProgramFiles\Anaconda3
  • E:\ProgramFiles\Anaconda3\Scripts

以后多一个:

  • E:\ProgramFiles\Anaconda3\condabin\

并且按照conda.bat info -e来运行

你可能感兴趣的:(python3)