AttributeError:dlsym(0x7f9163cea8e0,archive_read_open_filename_w):找不到符号

时间:2019-07-03 10:33:04

标签: python anaconda conda

我正在尝试在Macos上安装Anaconda,并且已经下载了.pkg文件。我默认遵循了说明,但是当我运行conda list时,它显示以下错误:

环境

MacOS:10.13.6

conda:4.7.5

Python:Python 3.6.3 :: Anaconda,Inc。

此外,我的Jupiter笔记本电脑没有显示conda选项卡。无法弄清楚环境是什么问题

Traceback (most recent call last):
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1043, in __call__
    return func(*args, **kwargs)
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 84, in _main
    exit_code = do_call(args, p)
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 80, in do_call
    module = import_module(relative_mod, __name__.rsplit('.', 1)[0])
  File "/Users/bijing/anaconda3/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/conda/cli/main_list.py", line 14, in <module>
    from ..core.prefix_data import PrefixData
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/conda/core/prefix_data.py", line 24, in <module>
    from ..gateways.disk.create import write_as_json_to_file
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/conda/gateways/disk/create.py", line 17, in <module>
    import conda_package_handling.api
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/conda_package_handling/api.py", line 3, in <module>
    from libarchive.exception import ArchiveError as _LibarchiveArchiveError
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/libarchive/__init__.py", line 1, in <module>
    from .entry import ArchiveEntry
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/libarchive/entry.py", line 6, in <module>
    from . import ffi
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/libarchive/ffi.py", line 184, in <module>
    c_int, check_int)
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/libarchive/ffi.py", line 95, in ffi
    f = getattr(libarchive, 'archive_'+name)
  File "/Users/bijing/anaconda3/lib/python3.6/ctypes/__init__.py", line 361, in __getattr__
    func = self.__getitem__(name)
  File "/Users/bijing/anaconda3/lib/python3.6/ctypes/__init__.py", line 366, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(0x7fd82e4f0160, archive_read_open_filename_w): symbol not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/bijing/anaconda3/bin/conda", line 13, in <module>
    sys.exit(main())
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 150, in main
    return conda_exception_handler(_main, *args, **kwargs)
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1335, in conda_exception_handler
    return_value = exception_handler(func, *args, **kwargs)
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1046, in __call__
    return self.handle_exception(exc_val, exc_tb)
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1090, in handle_exception
    return self.handle_unexpected_exception(exc_val, exc_tb)
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1101, in handle_unexpected_exception
    self.print_unexpected_error_report(error_report)
  File "/Users/bijing/anaconda3/lib/python3.6/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/bijing/anaconda3/lib/python3.6/site-packages/conda/cli/main_info.py", line 19, in <module>
    from ..core.index import _supplement_index_with_system
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/conda/core/index.py", line 9, in <module>
    from .package_cache_data import PackageCacheData
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/conda/core/package_cache_data.py", line 15, in <module>
    from conda_package_handling.api import InvalidArchiveError
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/conda_package_handling/api.py", line 7, in <module>
    from .tarball import CondaTarBZ2 as _CondaTarBZ2
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/conda_package_handling/tarball.py", line 7, in <module>
    import libarchive
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/libarchive/__init__.py", line 1, in <module>
    from .entry import ArchiveEntry
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/libarchive/entry.py", line 6, in <module>
    from . import ffi
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/libarchive/ffi.py", line 184, in <module>
    c_int, check_int)
  File "/Users/bijing/anaconda3/lib/python3.6/site-packages/libarchive/ffi.py", line 95, in ffi
    f = getattr(libarchive, 'archive_'+name)
  File "/Users/bijing/anaconda3/lib/python3.6/ctypes/__init__.py", line 361, in __getattr__
    func = self.__getitem__(name)
  File "/Users/bijing/anaconda3/lib/python3.6/ctypes/__init__.py", line 366, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(0x7fd82e4f0160, archive_read_open_filename_w): symbol not found

1 个答案:

答案 0 :(得分:0)

zhihu的方法中修复了我的错误

我在这里记录了我的步骤,供其他用户参考:

在Mac上导致此错误的原因是之前已安装Python,我试图删除所有python和Anaconda文件,然后再次安装anaconda,然后成功运行conda命令。

  1. 从Macintouch-> Frameworks-> PythonFramework-> Versions-> 3.x中删除python
  2. 删除.bash_profile中有关python和anaconda的所有记录(通过shift + command +查找此隐藏文件。)
  3. 在应用程序中删除anaconda导航器
  4. 再次安装Anaconda