[英]Homebrew upgrade to Python 2.7.10_2 causes packages to fail with 'image not found'
更新Homebrew后使用
brew update
brew upgrade --all
導致Python更新到2.7.10_2,pip(以及許多其他腳本)失敗了
cffi.ffiplatform.VerificationError: importing '/usr/local/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_a269d620xd5c405b7.so': dlopen(/usr/local/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_a269d620xd5c405b7.so, 2): Library not loaded: /usr/local/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_a269d620xd5c405b7.so
Reason: image not found
我該怎么做才能恢復或調整我的Python配置,以便它再次運行? Homebrew做了什么摧毀了它?
Traceback (most recent call last):
File "/usr/local/bin/eb", line 7, in <module>
from ebcli.core.ebcore import main
File "/usr/local/lib/python2.7/site-packages/ebcli/core/ebcore.py", line 43, in <module>
from . import globals, base, io, hooks
File "/usr/local/lib/python2.7/site-packages/ebcli/core/hooks.py", line 20, in <module>
from ..lib import aws
File "/usr/local/lib/python2.7/site-packages/ebcli/lib/aws.py", line 19, in <module>
import botocore.session
File "/usr/local/lib/python2.7/site-packages/ebcli/bundled/botocore/session.py", line 27, in <module>
import botocore.credentials
File "/usr/local/lib/python2.7/site-packages/ebcli/bundled/botocore/credentials.py", line 30, in <module>
from botocore.utils import InstanceMetadataFetcher, parse_key_val_file
File "/usr/local/lib/python2.7/site-packages/ebcli/bundled/botocore/utils.py", line 25, in <module>
from botocore.vendored import requests
File "/usr/local/lib/python2.7/site-packages/ebcli/bundled/botocore/vendored/requests/__init__.py", line 53, in <module>
from .packages.urllib3.contrib import pyopenssl
File "/usr/local/lib/python2.7/site-packages/ebcli/bundled/botocore/vendored/requests/packages/urllib3/contrib/pyopenssl.py", line 55, in <module>
import OpenSSL.SSL
File "/usr/local/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/usr/local/lib/python2.7/site-packages/OpenSSL/rand.py", line 11, in <module>
from OpenSSL._util import (
File "/usr/local/lib/python2.7/site-packages/OpenSSL/_util.py", line 7, in <module>
binding = Binding()
File "/usr/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 114, in __init__
self._ensure_ffi_initialized()
File "/usr/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 126, in _ensure_ffi_initialized
cls._modules,
File "/usr/local/lib/python2.7/site-packages/cryptography/hazmat/bindings/utils.py", line 31, in load_library_for_binding
lib = ffi.verifier.load_library()
File "/usr/local/lib/python2.7/site-packages/cffi/verifier.py", line 97, in load_library
return self._load_library()
File "/usr/local/lib/python2.7/site-packages/cffi/verifier.py", line 207, in _load_library
return self._vengine.load_library()
File "/usr/local/lib/python2.7/site-packages/cffi/vengine_cpy.py", line 155, in load_library
raise ffiplatform.VerificationError(error)
cffi.ffiplatform.VerificationError: importing '/usr/local/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_a269d620xd5c405b7.so': dlopen(/usr/local/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_a269d620xd5c405b7.so, 2): Library not loaded: /usr/local/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_a269d620xd5c405b7.so
Reason: image not found
OSX 10.10.4; 自制語0.9.5
蒂姆史密斯的答案是正確的(他是一個自制的維護者!)但它沒有提供實際的修復。 在梳理完這些問題后, https://github.com/Homebrew/homebrew/issues/41613和https://github.com/pyca/cryptography/issues/2138以下內容應該讓你的python/pip
再次使用openssl
brew link openssl --force
pip uninstall cryptography
pip install cryptography --no-use-wheel
brew unlink openssl
第一個鏈接暫時修復了pip。 密碼學是需要重建的庫。 最后再取消openssl的聯系。
這是一次性錯誤,其原因是:1)我們決定刪除OpenSSL的“僅keg”名稱,然后2)我們發現它創建了顯着的不兼容性后,我們隨后退出該決定。 如果你在OpenSSL不是keg-only期間從源代碼打開了openssl的東西,那么需要重建它。 這是因為普通軟件包的install_names是相對於HOMEBREW_PREFIX而且僅keg軟件包沒有鏈接到HOMEBREW_PREFIX。 (僅限桶的軟件包具有指向私有前綴的install_names。)對於給您帶來的不便,我深感抱歉。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.