在我们的linux redhat RHEL 6集群上,我下载了cryptography-0.8.2.tar.gz然后运行
python setup.py install --user
在cryptography-0.8.2目录中。我收到以下错误。任何人都可以帮我解决吗?我不想加速弱引用,只是尝试安装加密模块。非常感谢!
rcook@rzgpu2 (cryptography-0.8.2 ): python setup.py install --user
running install
Traceback (most recent call last):
File "setup.py", line 342, in <module>
**keywords_with_side_effects(sys.argv)
File "/usr/apps/python/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/apps/python/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/apps/python/lib/python2.7/distutils/dist.py", line 971, in run_command
cmd_obj.ensure_finalized()
File "/usr/apps/python/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "setup.py", line 119, in finalize_options
self.distribution.ext_modules = get_ext_modules()
File "setup.py", line 78, in get_ext_modules
from cryptography.hazmat.bindings.commoncrypto.binding import (
File "src/cryptography/hazmat/bindings/commoncrypto/binding.py", line 14, in <module>
class Binding(object):
File "src/cryptography/hazmat/bindings/commoncrypto/binding.py", line 36, in Binding
"-framework", "Security", "-framework", "CoreFoundation"
File "src/cryptography/hazmat/bindings/utils.py", line 97, in build_ffi_for_binding
extra_link_args=extra_link_args,
File "src/cryptography/hazmat/bindings/utils.py", line 106, in build_ffi
ffi.cdef(cdef_source)
File "/g/g0/rcook/.local/lib/python2.7/site-packages/cffi/api.py", line 106, in cdef
self._parser.parse(csource, override=override, packed=packed)
File "/g/g0/rcook/.local/lib/python2.7/site-packages/cffi/cparser.py", line 165, in parse
self._internal_parse(csource)
File "/g/g0/rcook/.local/lib/python2.7/site-packages/cffi/cparser.py", line 199, in _internal_parse
realtype = self._get_type(decl.type, name=decl.name)
File "/g/g0/rcook/.local/lib/python2.7/site-packages/cffi/cparser.py", line 360, in _get_type
return self._get_struct_union_enum_type('struct', type, name)
File "/g/g0/rcook/.local/lib/python2.7/site-packages/cffi/cparser.py", line 434, in _get_struct_union_enum_type
return self._structnode2type[type]
File "/usr/apps/python/lib/python2.7/weakref.py", line 256, in __getitem__
return self.data[ref(key)]
TypeError: cannot create weak reference to 'Struct' object
答案 0 :(得分:7)
问题实际上在pycparser模块中。
根据https://bugs.launchpad.net/openstack-gate/+bug/1446882执行以下操作:
pip uninstall pycparser && pip install -Iv pycparser==2.10
答案 1 :(得分:5)
事实证明,pycparser-2.11是此错误消息/错误的罪魁祸首。
pip uninstall pycparser&amp;&amp; pip install -Iv pycparser == 2.10