PyKCS11 icon indicating copy to clipboard operation
PyKCS11 copied to clipboard

Failed to install PyKCS11 1.5.3 via buildout

Open fbjorn opened this issue 6 years ago • 1 comments

  • Operating system used: Windows 10 x64
  • PyKCS11 version: 1.5.3
  • Python version: 3.5/3.6
  • PKCS#11 library used: -

Failed to install PyKCS11 1.5.3 via buildout. But it works fine with 1.4.4.

Steps for reproducing this issue:

  1. pip install zc.buildout
  2. put this in your buildout.cfg:
[buildout]
parts = pykcs11

[pykcs11]
recipe = zc.recipe.egg
eggs = PyKCS11
  1. run buildout -c buildout.cfg
  2. run simple python script:
import sys
sys.path.append('eggs\\pykcs11-1.5.3-py3.5-win-amd64.egg')
from PyKCS11 import *

result:

Traceback (most recent call last):
  File "test.py", line 4, in <module>
    from PyKCS11 import *
  File "eggs\pykcs11-1.5.3-py3.5-win-amd64.egg\PyKCS11\__init__.py", line 20, in <module>
    import PyKCS11.LowLevel
ImportError: No module named 'PyKCS11.LowLevel'

A little bit stange warnings from the compilation part:

file PyKCS11\LowLevel.py (for module PyKCS11.LowLevel) not found
file PyKCS11\LowLevel.py (for module PyKCS11.LowLevel) not found
file PyKCS11\LowLevel.py (for module PyKCS11.LowLevel) not found
ck_attribute_smart.cpp
pkcs11lib.cpp
pykcs11string.cpp
utility.cpp
pykcs11_wrap.cpp
pykcs11.cpp
dyn_win32.c
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Copyright (C) Microsoft Corporation.  All rights reserved.

pykcs11_wrap.obj : warning LNK4197: export 'PyInit__LowLevel' specified multiple times; using first specification
   Creating library build\temp.win-amd64-3.5\Release\src\_LowLevel.cp35-win_amd64.lib and object build\temp.win-amd64-3.5\Release\src\_LowLevel.cp35-win_amd64.exp
Generating code
Finished generating code
zip_safe flag not set; analyzing archive contents...
PyKCS11.__pycache__._LowLevel.cpython-35: module references __file__
Got pykcs11 1.5.3.

I think it may be related to #32

fbjorn avatar Feb 18 '19 14:02 fbjorn

I never used buildout before. I just tried on macOS. I also get:

file PyKCS11/LowLevel.py (for module PyKCS11.LowLevel) not found
file PyKCS11/LowLevel.py (for module PyKCS11.LowLevel) not found
file PyKCS11/LowLevel.py (for module PyKCS11.LowLevel) not found

during the build.

My first guess is that your buildout.cfg is not complete.

If you think the problem comes from PyKCS11 then please provide a patch.

LudovicRousseau avatar Feb 21 '19 22:02 LudovicRousseau

It works for me with PyKCS11 1.5.13. But that is because the package is downloaded from pypi

[rousseau:~/tmp] <buildout> $ buildout -c buildout.cfg
Creating directory '/Users/rousseau/tmp/eggs'.
Creating directory '/Users/rousseau/tmp/bin'.
Creating directory '/Users/rousseau/tmp/parts'.
Creating directory '/Users/rousseau/tmp/develop-eggs'.
root: Reading https://pypi.org/simple/zc.recipe.egg/
Getting distribution for 'zc.recipe.egg>=2.0.6'.
root: Downloading https://files.pythonhosted.org/packages/7a/6f/c6871e8490a153c3b44ac43e4a6552d802561a12b4780c7ea088a7ec5ff0/zc.recipe.egg-2.0.7.tar.gz#sha256=b89eb00979614e3584bb4e8431172b2345d00b983a04ebf00a401fb695f4e6d3

[notice] A new release of pip is available: 23.3.1 -> 23.3.2
[notice] To update, run: pip install --upgrade pip
Got zc.recipe.egg 2.0.7.
Installing pykcs11.
root: Reading https://pypi.org/simple/PyKCS11/
Getting distribution for 'PyKCS11'.
root: Downloading https://files.pythonhosted.org/packages/24/15/41a49a55251ea1c66934fcde39cd157244f82cb3619a215ca615a37ed6f5/PyKCS11-1.5.13-cp311-cp311-macosx_13_0_x86_64.whl#sha256=500f65bcac7003da12b9f63b01e84b0150df8c47a0661364f8de4b7e05c4d41a
Got PyKCS11 1.5.13.
[rousseau:~/tmp] <buildout> 2s $ python
Python 3.11.7 (main, Dec  4 2023, 18:10:11) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.append('eggs/PyKCS11-1.5.13-py3.11-macosx-13-x86_64.egg')
>>> from PyKCS11 import *
>>> ^D

LudovicRousseau avatar Jan 07 '24 16:01 LudovicRousseau