首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Python错误不能导入名称certificate_transparency

Python错误不能导入名称certificate_transparency
EN

Stack Overflow用户
提问于 2017-11-18 17:41:53
回答 6查看 18.1K关注 0票数 4

试图运行pymodbus tcp服务器并获取堆栈跟踪.完全失去了这里,所以任何帮助都是非常感谢的。谢谢!

代码语言:javascript
复制
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
EN

回答 6

Stack Overflow用户

回答已采纳

发布于 2017-12-04 21:24:01

我在使用pip 7,也遇到了同样的问题。升级到pip 9解决了这个问题。我不确定原因。

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

票数 1
EN

Stack Overflow用户

发布于 2018-02-21 04:04:49

在尝试使用https://github.com/oracle/solaris-userland/构建系统更新Solaris 11.4的Python时,我一直在尝试这样做。对我来说,对pip的“简单”更新不是一种选择,我们不是这样做的。

我最终想出了解决方案:我错误地构建了这个包。

密码学2.1.4依赖于cffi > 1.7。与我们交付的版本相比,这两个包都有新的可交付比特。

未能更新包清单以正确跟踪新文件,将导致cffi和密码学无法导入当前版本所依赖的符号。

非常感谢#密码学中的亚历克斯·盖诺,他让我走上了正确的道路。

代码语言:javascript
复制
$ python2.7   
Python 2.7.14 (default, Jan 31 2018, 05:35:05) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> from cryptography.hazmat.bindings._openssl import ffi, lib
>>> from cryptography.x509 import certificate_transparency
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/vendor-packages/cryptography/x509/__init__.py", line 7, in <module>
    from cryptography.x509 import certificate_transparency
ImportError: cannot import name certificate_transparency

如果您构建了密码学并查看它提供了什么,您会发现实际上有一个文件( Solaris作为/usr/lib/python-$(PYVER)/vendor-packages/cryptography/x509/certificate_transparency.py提供)-如果该文件不在层次结构的其他部分,那么您最终得到的正是这个ImportError。

票数 1
EN

Stack Overflow用户

发布于 2018-04-03 12:10:36

它对我有用(paramiko的问题):

https://pypi.python.org/pypi/ctutlz/0.7.0

pip安装-进程依赖-链接ctutlz

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47369117

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档