Skip to content

pip install fails #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alxnik opened this issue Oct 11, 2017 · 11 comments
Closed

pip install fails #11

alxnik opened this issue Oct 11, 2017 · 11 comments
Labels

Comments

@alxnik
Copy link

alxnik commented Oct 11, 2017

Hello,
When installing v0.4.0 on CentOS 7 with python 3.4 (from epel), the procedure fails with the message:

Collecting python-pkcs11
Using cached python-pkcs11-0.4.0.tar.gz
Complete output from command python setup.py egg_info:
Compiling /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Plex/Scanners.py because it changed.
Compiling /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Plex/Actions.py because it changed.
Compiling /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Compiler/Pythran.py because it changed.
Compiling /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Compiler/Lexicon.py because it changed.
Compiling /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Compiler/Scanning.py because it changed.
Compiling /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Compiler/Parsing.py because it changed.
Compiling /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Compiler/Visitor.py because it changed.
Compiling /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Compiler/FlowControl.py because it changed.
Compiling /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Compiler/Code.py because it changed.
Compiling /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Runtime/refnanny.pyx because it changed.
Compiling /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Tempita/_tempita.py because it changed.
[ 1/11] Cythonizing /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Compiler/Code.py
[ 2/11] Cythonizing /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Compiler/FlowControl.py
[ 3/11] Cythonizing /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Compiler/Lexicon.py
[ 4/11] Cythonizing /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Compiler/Parsing.py
[ 5/11] Cythonizing /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Compiler/Pythran.py
[ 6/11] Cythonizing /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Compiler/Scanning.py
[ 7/11] Cythonizing /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Compiler/Visitor.py
[ 8/11] Cythonizing /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Plex/Actions.py
[ 9/11] Cythonizing /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Plex/Scanners.py
[10/11] Cythonizing /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Runtime/refnanny.pyx
[11/11] Cythonizing /tmp/easy_install-a9ozvf88/Cython-0.27.1/Cython/Tempita/_tempita.py
Unable to find pgen, not compiling formal grammar.
warning: no files found matching '2to3-fixers.txt'
warning: no files found matching 'Doc/'
warning: no files found matching '
.pyx' under directory 'Cython/Debugger/Tests'
warning: no files found matching '.pxd' under directory 'Cython/Debugger/Tests'
warning: no files found matching '
.pxd' under directory 'Cython/Utility'

Installed /tmp/pip-build-4xbb9fkr/python-pkcs11/.eggs/Cython-0.27.1-py3.4-linux-x86_64.egg
error in python-pkcs11 setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected version spec in aenum; python_version < "3.6" at ; python_version < "3.6"

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-4xbb9fkr/python-pkcs11/

@danni
Copy link
Collaborator

danni commented Oct 12, 2017

Hi, you need a newer setuptools. It's meant to upgrade setuptools when it installs, but I'm guessing it needs a newer setuptools to do that.

@danni danni added the question label Oct 12, 2017
@alxnik
Copy link
Author

alxnik commented Oct 12, 2017

Hello,
I have resolved this issue by removing the "python_version < "3.6"" and reinstalling.

I'm not very keen on upgrading setuptools since it comes as part of the distribution and is supported as part of that. Is there a way to add backwards compatibility to the package itself?

Thanks

@danni
Copy link
Collaborator

danni commented Oct 12, 2017 via email

@revTimo
Copy link

revTimo commented Oct 22, 2017

hi @danni
when i install on window 8.1 i got this error,,,can u tell me how to fix

C:\Python27\Scripts>pip install python-pkcs11
Collecting python-pkcs11
Using cached python-pkcs11-0.4.0.tar.gz
Complete output from command python setup.py egg_info:
Compiling c:\users\tuangp1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cython\Plex\Sca
nners.py because it changed.
Compiling c:\users\tuangp
1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cython\Plex\Act
ions.py because it changed.
Compiling c:\users\tuangp1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cython\Compiler
\Pythran.py because it changed.
Compiling c:\users\tuangp
1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cython\Compiler
\Lexicon.py because it changed.
Compiling c:\users\tuangp1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cython\Compiler
\Scanning.py because it changed.
Compiling c:\users\tuangp
1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cython\Compiler
\Parsing.py because it changed.
Compiling c:\users\tuangp1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cython\Compiler
\Visitor.py because it changed.
Compiling c:\users\tuangp
1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cython\Compiler
\FlowControl.py because it changed.
Compiling c:\users\tuangp1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cython\Compiler
\Code.py because it changed.
Compiling c:\users\tuangp
1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cython\Runtime
refnanny.pyx because it changed.
Compiling c:\users\tuangp1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cython\Tempita
_tempita.py because it changed.
[ 1/11] Cythonizing c:\users\tuangp
1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cytho
n\Compiler\Code.py
[ 2/11] Cythonizing c:\users\tuangp1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cytho
n\Compiler\FlowControl.py
[ 3/11] Cythonizing c:\users\tuangp
1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cytho
n\Compiler\Lexicon.py
[ 4/11] Cythonizing c:\users\tuangp1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cytho
n\Compiler\Parsing.py
[ 5/11] Cythonizing c:\users\tuangp
1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cytho
n\Compiler\Pythran.py
[ 6/11] Cythonizing c:\users\tuangp1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cytho
n\Compiler\Scanning.py
[ 7/11] Cythonizing c:\users\tuangp
1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cytho
n\Compiler\Visitor.py
[ 8/11] Cythonizing c:\users\tuangp1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cytho
n\Plex\Actions.py
[ 9/11] Cythonizing c:\users\tuangp
1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cytho
n\Plex\Scanners.py
[10/11] Cythonizing c:\users\tuangp1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cytho
n\Runtime\refnanny.pyx
[11/11] Cythonizing c:\users\tuangp
1\appdata\local\temp\easy_install-ebiqis\Cython-0.27.1\Cytho
n\Tempita_tempita.py
Unable to find pgen, not compiling formal grammar.
warning: no files found matching '2to3-fixers.txt'
warning: no files found matching 'Doc*'
warning: no files found matching '.pyx' under directory 'Cython\Debugger\Tests'
warning: no files found matching '
.pxd' under directory 'Cython\Debugger\Tests'
warning: no files found matching '*.pxd' under directory 'Cython\Utility'
Traceback (most recent call last):
File "", line 1, in
File "c:\users\tuangp~1\appdata\local\temp\pip-build-b67fry\python-pkcs11\setup.py", line 65,
in
test_suite='tests',
File "c:\python27\lib\distutils\core.py", line 111, in setup
setup_distribution = dist = klass(attrs)
File "c:\python27\lib\site-packages\setuptools\dist.py", line 335, in init
self.fetch_build_eggs(attrs['setup_requires'])
File "c:\python27\lib\site-packages\setuptools\dist.py", line 456, in fetch_build_eggs
replace_conflicting=True,
File "c:\python27\lib\site-packages\pkg_resources\init.py", line 863, in resolve
replace_conflicting=replace_conflicting
File "c:\python27\lib\site-packages\pkg_resources\init.py", line 1141, in best_match
return self.obtain(req, installer)
File "c:\python27\lib\site-packages\pkg_resources\init.py", line 1153, in obtain
return installer(requirement)
File "c:\python27\lib\site-packages\setuptools\dist.py", line 522, in fetch_build_egg
return cmd.easy_install(req)
File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", line 672, in easy_ins
tall
return self.install_item(spec, dist.location, tmpdir, deps)
File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", line 698, in install

item
dists = self.install_eggs(spec, download, tmpdir)
File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", line 879, in install_
eggs
return self.build_and_install(setup_script, setup_base)
File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", line 1118, in build_a
nd_install
self.run_setup(setup_script, setup_base, args)
File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", line 1106, in run_set
up
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: Microsoft Visual C++ 9.0 is req
uired. Get it from http://aka.ms/vcpython27

Command "python setup.py egg_info" failed with error code 1 in c:\users\tuangp~1\appdata\local\temp
pip-build-b67fry\python-pkcs11\

@danni
Copy link
Collaborator

danni commented Oct 22, 2017

Hi @revTimo,

Python 2.7 is not supported. You need at least Python 3.4+. Additionally, it probably doesn't work on Windows yet, as the PKCS#11 lib is loaded via dlopen and there's no Windows mechanism in place.

@revTimo
Copy link

revTimo commented Oct 22, 2017

thanks for your reply @danni

so do u have any advice for developing with window and Python 2.7

@danni
Copy link
Collaborator

danni commented Oct 23, 2017

The code will never support Python 2.7, it just uses too many Python 3.x features. As for supporting Windows, it's possible, but I haven't tried yet as it hasn't been needed.

@luisza
Copy link

luisza commented Oct 23, 2017

Hi, I will need also Windows and MacOS support for my project, so I can help porting to this Operating Systems, but I have planning to work on that in January or February of the next year.

@danni
Copy link
Collaborator

danni commented Oct 23, 2017

macOS should work, I wrote the original code under macOS and have used it to connect to the Nitrokey HSM. It could be added to CI if anyone is aware of a free service (never mind, I've realised I can do it on Travis). Windows doesn't have dlopen so that will need replacing with a call to LoadLibrary.

@revTimo
Copy link

revTimo commented Oct 26, 2017

hello again @danni

i just upgrade python to version 3.6 and install again pkcs11-tool.
i got a problem in my installing, i dont know what is the error,,

C:\Python34\Scripts>pip install python-pkcs11
Collecting python-pkcs11
Using cached python-pkcs11-0.4.0.tar.gz
Requirement already satisfied: asn1crypto in c:\python34\lib\site-packages (from
python-pkcs11)
Requirement already satisfied: cached-property in c:\python34\lib\site-packages
(from python-pkcs11)
Installing collected packages: python-pkcs11
Running setup.py install for python-pkcs11 ... error
Complete output from command c:\python34\python.exe -u -c "import setuptools
, tokenize;file='C:\Users\NP-0198\AppData\Local\Temp\pip-build-4q3g8l6
x\python-pkcs11\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.r
ead().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" ins
tall --record C:\Users\NP-0198\AppData\Local\Temp\pip-0i6kvj9a-record\install-re
cord.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win32-3.6
creating build\lib.win32-3.6\pkcs11
copying pkcs11\constants.py -> build\lib.win32-3.6\pkcs11
copying pkcs11\defaults.py -> build\lib.win32-3.6\pkcs11
copying pkcs11\exceptions.py -> build\lib.win32-3.6\pkcs11
copying pkcs11\mechanisms.py -> build\lib.win32-3.6\pkcs11
copying pkcs11\types.py -> build\lib.win32-3.6\pkcs11
copying pkcs11_init_.py -> build\lib.win32-3.6\pkcs11
creating build\lib.win32-3.6\pkcs11\util
copying pkcs11\util\dh.py -> build\lib.win32-3.6\pkcs11\util
copying pkcs11\util\dsa.py -> build\lib.win32-3.6\pkcs11\util
copying pkcs11\util\ec.py -> build\lib.win32-3.6\pkcs11\util
copying pkcs11\util\rsa.py -> build\lib.win32-3.6\pkcs11\util
copying pkcs11\util\x509.py -> build\lib.win32-3.6\pkcs11\util
copying pkcs11\util_init_.py -> build\lib.win32-3.6\pkcs11\util
running egg_info
writing python_pkcs11.egg-info\PKG-INFO
writing dependency_links to python_pkcs11.egg-info\dependency_links.txt
writing requirements to python_pkcs11.egg-info\requires.txt
writing top-level names to python_pkcs11.egg-info\top_level.txt
reading manifest file 'python_pkcs11.egg-info\SOURCES.txt'
writing manifest file 'python_pkcs11.egg-info\SOURCES.txt'
copying pkcs11_errors.pyx -> build\lib.win32-3.6\pkcs11
copying pkcs11_loader.pyx -> build\lib.win32-3.6\pkcs11
copying pkcs11_pkcs11.pyx -> build\lib.win32-3.6\pkcs11
copying pkcs11_pkcs11_defn.pxd -> build\lib.win32-3.6\pkcs11
copying pkcs11_utils.pyx -> build\lib.win32-3.6\pkcs11
running build_ext
cythoning pkcs11/_loader.pyx to pkcs11_loader.c
building 'pkcs11._loader' extension
creating build\temp.win32-3.6
creating build\temp.win32-3.6\Release
creating build\temp.win32-3.6\Release\pkcs11
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo
/Ox /W3 /GL /DNDEBUG /MD -Ic:\python34\include -Ic:\python34\include "-IC:\Prog
ram Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x8
6)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows
Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um"
"-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tcpkcs11_loader.c /F
obuild\temp.win32-3.6\Release\pkcs11_loader.obj
_loader.c
pkcs11_loader.c(523): fatal error C1083: Cannot open include file: 'dlfcn.h
': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\B
IN\cl.exe' failed with exit status 2

----------------------------------------

Command "c:\python34\python.exe -u -c "import setuptools, tokenize;file='C:
\Users\NP-0198\AppData\Local\Temp\pip-build-4q3g8l6x\python-pkcs11\setup.
py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '
n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\N
P-0198\AppData\Local\Temp\pip-0i6kvj9a-record\install-record.txt --single-versio
n-externally-managed --compile" failed with error code 1 in C:\Users\NP-0198\App
Data\Local\Temp\pip-build-4q3g8l6x\python-pkcs11\

@danni
Copy link
Collaborator

danni commented Oct 26, 2017

Windows support is #12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants