当前位置:  开发笔记 > 编程语言 > 正文

python fabric错误'module'对象没有属性'HAVE_DECL_MPZ_POWM_SEC'

如何解决《pythonfabric错误'module'对象没有属性'HAVE_DECL_MPZ_POWM_SEC'》经验,为你挑选了1个好方法。

运行结构时出现以下错误

(ENV)[root@server-124 ENV]# fab
Traceback (most recent call last):
  File "/usr/bin/fab", line 9, in 
    load_entry_point('Fabric==1.8.3', 'console_scripts', 'fab')()
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 299, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2229, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1948, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.6/site-packages/fabric/main.py", line 19, in 
    from fabric import api, state, colors
  File "/usr/lib/python2.6/site-packages/fabric/api.py", line 9, in 
    from fabric.context_managers import (cd, hide, settings, show, path, prefix,
  File "/usr/lib/python2.6/site-packages/fabric/context_managers.py", line 42, in 
    from fabric.state import output, win32, connections, env
  File "/usr/lib/python2.6/site-packages/fabric/state.py", line 9, in 
    from fabric.network import HostConnectionCache, ssh
  File "/usr/lib/python2.6/site-packages/fabric/network.py", line 24, in 
    import paramiko as ssh
  File "/usr/lib/python2.6/site-packages/paramiko/__init__.py", line 31, in 
    from transport import SecurityOptions, Transport
  File "/usr/lib/python2.6/site-packages/paramiko/transport.py", line 33, in 
    from paramiko import util
  File "/usr/lib/python2.6/site-packages/paramiko/util.py", line 33, in 
    from paramiko.common import *
  File "/usr/lib/python2.6/site-packages/paramiko/common.py", line 98, in 
    from Crypto import Random
  File "/usr/lib64/python2.6/site-packages/Crypto/Random/__init__.py", line 29, in 
    from Crypto.Random import _UserFriendlyRNG
  File "/usr/lib64/python2.6/site-packages/Crypto/Random/_UserFriendlyRNG.py", line 38, in 
    from Crypto.Random.Fortuna import FortunaAccumulator
  File "/usr/lib64/python2.6/site-packages/Crypto/Random/Fortuna/FortunaAccumulator.py", line 39, in 
    import FortunaGenerator
  File "/usr/lib64/python2.6/site-packages/Crypto/Random/Fortuna/FortunaGenerator.py", line 34, in 
    from Crypto.Util.number import ceil_shift, exact_log2, exact_div
  File "/usr/lib64/python2.6/site-packages/Crypto/Util/number.py", line 56, in 
    if _fastmath is not None and not _fastmath.HAVE_DECL_MPZ_POWM_SEC:
AttributeError: 'module' object has no attribute 'HAVE_DECL_MPZ_POWM_SEC'

我已经提到了其他一些帖子,说它"所以你正在使用较新版本的PyCrypto和旧版本的_fastmath." 所以我也安装了gmp-devel

我使用的是virtualenv,Centos 6,Python 2.6

请帮忙.



1> djhaskin987..:

这为我修好了:

pip install PyCrypto==2.3

我没有卸载,python-crypto因为我需要的其他软件包依赖它.我只是运行上面的pip命令,一切正常:)

推荐阅读
惬听风吟jyy_802
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有