Import error in jwkest.jwk
joshuabach opened this issue · 6 comments
Problem
On my system the following import in src/jwkest/jwk.py:13 failes:
[...]
11 from Crypto.PublicKey import RSA
12 from Crypto.PublicKey.RSA import importKey
13 from Crypto.PublicKey.RSA import RsaKey # <-- Thats the one
14 from Crypto.Util.asn1 import DerSequence
[...]
with the error message:
>>> import jwkest.jwk
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.5/site-packages/jwkest/jwk.py", line 13, in <module>
from Crypto.PublicKey.RSA import RsaKey
ImportError: cannot import name 'RsaKey'
Workaround
The import does not seem to be used. When i remove the faulting line 13 (from Crypto.PublicKey.RSA import RsaKey
) everything works fine.
Software
- python 3.5.1
- pyjwkest 1.1.0
- pycrypto 2.6.1
- pycryptodome 3.3.1
- (everything from Archlinux stable)
+1
This is due to a conflict between the two crypto libraries, pycrypto
and pycryptodome
. So if possible make sure that only pycryptodome
is installed in your environment.
This is problem with pyjwkest - still in development and it changes very often. Maybe freeze the version ?
On 25 Feb 2016, at 22:37, Rebecka Gulliksson notifications@github.com wrote:
This is due to a conflict between the two crypto libraries, pycrypto and pycryptodome. So if possible make sure that only pycryptodome is installed in your environment.
—
Reply to this email directly or view it on GitHub https://github.com/rohe/pyjwkest/issues/52#issuecomment-189015512.
The problem here is that pycrypto is used by fabric / paramiko, and this is causing a lot of issues. Python packaging does not provide much help in this case, but using pyjwkest in the same virtualenv as fabric it's a bit PITA
The usage of pycryptodomex as a requirement should fix this because it will get Cryptodome installed beside Crypto and not one on top of the other.