PyKCS11安装

时间:2016-02-03 16:27:29

标签: python macos

我想安装并使用PyKCS11到我的mac(通过终端)。我想在整个过程中使用python3。我从这里下载了它:https://bitbucket.org/PyKCS11/pykcs11

我在/ usr / local / lib上安装了python3。我下载了文件夹,运行make build,一切正常。当我运行make install时,我得到以下内容:

python3 setup.py install --prefix=/usr/local --root=/
running install
running build
running build_py
running build_ext
running install_lib
running install_egg_info
Removing /usr/local/lib/python3.4/site-packages/PyKCS11-1.3.2-py3.4.egg-info
Writing /usr/local/lib/python3.4/site-packages/PyKCS11-1.3.2-py3.4.egg-info

(*删除...是我上次执行命令的时间)

之后,我打开python3并执行import PyKCS11 我收到以下错误:

>>> import PyKCS11
Traceback (most recent call last):
  File "/Users/Dkostas/Desktop/tools/PyKCS11/PyKCS11/LowLevel.py", line 18, in swig_import_helper
    fp, pathname, description = imp.find_module('_LowLevel', [dirname(__file__)])
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/imp.py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_LowLevel'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/Dkostas/Desktop/tools/PyKCS11/PyKCS11/__init__.py", line 20, in <module>
    import PyKCS11.LowLevel
  File "/Users/Dkostas/Desktop/tools/PyKCS11/PyKCS11/LowLevel.py", line 28, in <module>
    _LowLevel = swig_import_helper()
  File "/Users/Dkostas/Desktop/tools/PyKCS11/PyKCS11/LowLevel.py", line 20, in swig_import_helper
    import _LowLevel
ImportError: No module named '_LowLevel'

python3无法使用swig会出现问题吗?

Python2安装在不同的位置(/usr/lib/python2.7)
我用Homebrew安装python。

任何想法都赞赏。 提前谢谢!

1 个答案:

答案 0 :(得分:0)

您需要从PyKCS11目录中出来,有关更多信息,请检查以下链接 https://github.com/LudovicRousseau/PyKCS11/issues/70