Search code examples
pythoncryptographytwisted

Python Cryptography Error cannot import name certificate_transparency


trying to run a pymodbus tcp server and im getting this stack trace... at a total loss here so any help is appreciated. Thanks!

Traceback (most recent call last):
File "Worrking_ModbusJ1939Bridge.py", line 12, in <module>
from pymodbus.server.async import StartTcpServer
File "build/bdist.linux-armv7l/egg/pymodbus/server/async.py", line 18, in <module>
File "build/bdist.linux-armv7l/egg/pymodbus/internal/ptwisted.py", line 5, in <module>
File "/usr/local/lib/python2.7/dist-packages/twisted/conch/manhole_ssh.py", line 14, in <module>
from twisted.conch.ssh import factory, session
File "/usr/local/lib/python2.7/dist-packages/twisted/conch/ssh/factory.py", line 18, in <module>
from twisted.conch.ssh import (_kex, transport, userauth, connection)
File "/usr/local/lib/python2.7/dist packages/twisted/conch/ssh/transport.py", line 345, in <module>
class SSHTransportBase(protocol.Protocol):
File "/usr/local/lib/python2.7/dist-packages/twisted/conch/ssh/transport.py", line 469, in SSHTransportBase
supportedCiphers = _getSupportedCiphers()
File "/usr/local/lib/python2.7/dist-packages/twisted/conch/ssh/transport.py", line 335, in _getSupportedCiphers
backend=default_backend(),
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/__init__.py", line 15, in default_backend
from cryptography.hazmat.backends.openssl.backend import backend
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/__init__.py", line 7, in <module>
from cryptography.hazmat.backends.openssl.backend import backend
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/backend.py", line 16, in <module>
from cryptography import utils, x509
File "/usr/local/lib/python2.7/dist-packages/cryptography/x509/__init__.py", line 7, in <module>
from cryptography.x509 import certificate_transparency
ImportError: cannot import name certificate_transparency

Solution

  • I was using pip 7 and got the same problem. Upgrading to pip 9 solved it. I'm not sure about the cause.

    Via: https://github.com/micheloosterhof/cowrie/issues/618