我在 macOS Mojave 10.14.5 上使用 Anaconda Navigator 版本 1.9.7。我发现当我将以下命令添加到 .bashrc 时,大多数 anaconda-navigator、pip 等命令都停止工作。
export DYLD_LIBRARY_PATH=/opt/x11/lib/:/opt/local/lib/libgcc/:/opt/local/lib/gcc47/:$DYLD_LIBRARY_PATH
对于 pip 命令,我收到以下错误:
Traceback (most recent call last):
File "/Users/ahmedlasheen/anaconda3/bin/pip", line 7, in <module>
from pip._internal import main
File "/Users/ahmedlasheen/anaconda3/lib/python3.7/site-packages/pip/_internal/__init__.py", line 40, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/Users/ahmedlasheen/anaconda3/lib/python3.7/site-packages/pip/_internal/cli/autocompletion.py", line 8, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/Users/ahmedlasheen/anaconda3/lib/python3.7/site-packages/pip/_internal/cli/main_parser.py", line 12, in <module>
from pip._internal.commands import (
File "/Users/ahmedlasheen/anaconda3/lib/python3.7/site-packages/pip/_internal/commands/__init__.py", line 6, in <module>
from pip._internal.commands.completion import CompletionCommand
File "/Users/ahmedlasheen/anaconda3/lib/python3.7/site-packages/pip/_internal/commands/completion.py", line 6, in <module>
from pip._internal.cli.base_command import Command
File "/Users/ahmedlasheen/anaconda3/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 20, in <module>
from pip._internal.download import PipSession
File "/Users/ahmedlasheen/anaconda3/lib/python3.7/site-packages/pip/_internal/download.py", line 15, in <module>
from pip._vendor import requests, six, urllib3
File "/Users/ahmedlasheen/anaconda3/lib/python3.7/site-packages/pip/_vendor/requests/__init__.py", line 114, in <module>
from . import utils
File "/Users/ahmedlasheen/anaconda3/lib/python3.7/site-packages/pip/_vendor/requests/utils.py", line 26, in <module>
from ._internal_utils import to_native_string
File "/Users/ahmedlasheen/anaconda3/lib/python3.7/site-packages/pip/_vendor/requests/_internal_utils.py", line 11, in <module>
from .compat import is_py2, builtin_str, str
File "/Users/ahmedlasheen/anaconda3/lib/python3.7/site-packages/pip/_vendor/requests/compat.py", line 62, in <module>
from urllib.request import parse_http_list, getproxies, proxy_bypass, proxy_bypass_environment, getproxies_environment
File "/Users/ahmedlasheen/anaconda3/lib/python3.7/urllib/request.py", line 2583, in <module>
from _scproxy import _get_proxy_settings, _get_proxies
ImportError: dlopen(/Users/ahmedlasheen/anaconda3/lib/python3.7/lib-dynload/_scproxy.cpython-37m-darwin.so, 2): Symbol not found: __cg_png_create_info_struct
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /opt/x11/lib//libPng.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
该文件/opt/x11/lib//libPng.dylib
确实存在。
答案1
DYLD_FALLBACK_LIBRARY_PATH
我发现如果我使用而不是DYLD_LIBRARY_PATH
遵循, 错误就会消失这里的讨论