我通过pip安装nfcpy,但我很难设置它。在python shell中运行时,会出现以下错误:
>>> import nfc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/nfc/__init__.py", line 28, in <module>
from clf import ContactlessFrontend
File "/usr/local/lib/python2.7/site-packages/nfc/clf/__init__.py", line 34, in <module>
import nfc.llcp
File "/usr/local/lib/python2.7/site-packages/nfc/llcp/__init__.py", line 31, in <module>
from llc import LOGICAL_DATA_LINK, DATA_LINK_CONNECTION
File "/usr/local/lib/python2.7/site-packages/nfc/llcp/llc.py", line 41, in <module>
from . import sec
File "/usr/local/lib/python2.7/site-packages/nfc/llcp/sec.py", line 490, in <module>
OpenSSL = OpenSSLWrapper(libcrypto)
File "/usr/local/lib/python2.7/site-packages/nfc/llcp/sec.py", line 183, in __init__
self.crypto.EC_KEY_set_public_key_affine_coordinates.restype = c_int
File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 378, in __getattr__
func = self.__getitem__(name)
File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 383, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(0x7f81ca493370, EC_KEY_set_public_key_affine_coordinates): symbol not found
此错误消息的含义是什么,以及如何修复?
供参考,我使用以下配置:
操作系统:Mac OSX 10.10.5
NFC阅读器:RC-S380
Python 2.7.10
pip 8.1.2
nfcpy(0.11.1)
答案 0 :(得分:0)
以下是@ I&#39; L&#39;我在评论中的正确答案的重述:
您的自制软件缺少必需的OpenSSL依赖项。您可以通过自制软件,Macports安装OpenSSL,也可以自己编译和构建库。