# AttributeError: 'module' object has no attribute 'HAVE\_DECL\_MPZ\_POWM\_SEC'

**URL:** <https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-have-decl-mpz-powm-sec/15099>\
**Category:** Ansible Project\
**Created:** [April 28, 2014, 10:25am UTC](https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-have-decl-mpz-powm-sec/15099 "2014-04-28T10:25:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jitendra\_Nalwaya](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@Jitendra\_Nalwaya](https://forum.ansible.com/u/Jitendra_Nalwaya)\
**Post date:** [April 28, 2014, 10:25am UTC](https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-have-decl-mpz-powm-sec/15099/1 "2014-04-28T10:25:08Z")

</div>

**Trying to install ansible using**  **ansible-1.3.4-0.git201404030000.el6.noarch.rpm but it shows below error**

**[root@xyzabc0170 installables]# rpm -ivh ansible-1.3.4-0.git201404030000.el6.noarch.rpm**  
Preparing… ########################################### [100%]  
1:ansible ########################################### [100%]  
**[root@xyzabc0170 installables]# ansible**  
Traceback (most recent call last):  
File “/usr/bin/ansible”, line 24, in   
from ansible.runner import Runner  
File “/usr/lib/python2.6/site-packages/ansible/runner/ **init**.py”, line 37, in   
import ansible.inventory  
File “/usr/lib/python2.6/site-packages/ansible/inventory/ **init**.py”, line 27, in   
from ansible.inventory.script import InventoryScript  
File “/usr/lib/python2.6/site-packages/ansible/inventory/script.py”, line 25, in   
from ansible import utils  
File “/usr/lib/python2.6/site-packages/ansible/utils/ **init**.py”, line 67, in   
from keyczar.keys import AesKey  
File “/usr/lib/python2.6/site-packages/keyczar/keys.py”, line 34, in   
from Crypto.PublicKey import DSA  
File “/usr/lib64/python2.6/site-packages/Crypto/PublicKey/DSA.py”, line 88, in   
from Crypto.PublicKey import \_DSA, \_slowmath, pubkey  
File “/usr/lib64/python2.6/site-packages/Crypto/PublicKey/\_DSA.py”, line 30, in   
from Crypto.PublicKey.pubkey import \*  
File “/usr/lib64/python2.6/site-packages/Crypto/PublicKey/pubkey.py”, line 30, in   
from Crypto.Util.number import \*  
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’

---

<div class="post-metadata">

**Author:** ![Adam\_Morris](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Adam\_Morris](https://forum.ansible.com/u/Adam_Morris)\
**Post date:** [April 28, 2014, 4:57pm UTC](https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-have-decl-mpz-powm-sec/15099/2 "2014-04-28T16:57:43Z")

</div>

Why? If you’re using a Fedora/RedHat based OS then you should probably use the version from EPEL. This is currently ansible-1.5.3-1.el6.noarch. 1.3.4 is rather an old release, so unless there is some bizarre reason for using that particular version then I would highly suggest using the latest release.

[http://docs.ansible.com/intro\_installation.html#latest-release-via-yum](http://docs.ansible.com/intro_installation.html#latest-release-via-yum)

Adam

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [April 28, 2014, 7:43pm UTC](https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-have-decl-mpz-powm-sec/15099/3 "2014-04-28T19:43:34Z")

</div>

Yep, this happens when your SSL libraries don’t match up with your python crypto libraries.

Ansible 1.3.4 is also very old and contains numerous things you don’t want to deploy.

Grab the latest.

---

<div class="post-metadata">

**Author:** ![kesten\_broughton1](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@kesten\_broughton1](https://forum.ansible.com/u/kesten_broughton1)\
**Post date:** [April 29, 2014, 5:12pm UTC](https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-have-decl-mpz-powm-sec/15099/4 "2014-04-29T17:12:48Z")

</div>

This bit me enough times that i eventually added a task for it in my playbook for creating new ansible controllers.  
Its NOT pretty. But it works and i’ve had no ill issues from it.

#[https://github.com/ansible/ansible/issues/276](https://github.com/ansible/ansible/issues/276)

- name: Patch bug related to pycrypto  
lineinfile: dest=/usr/lib64/python2.6/site-packages/Crypto/Util/number.py  
regexp=“{{item.regexp}}” line=“{{item.line}}”  
with\_items:
- { regexp: “HAVE\_DECL\_MPZ\_POWM\_SEC”, line: “#if \_fastmath is not None and not \_fastmath.HAVE\_DECL\_MPZ\_POWM\_SEC:” }
- { regexp: “PowmInsecureWarning”, line: “# \_warn(‘Not using mpz\_powm\_sec. You should rebuild using libgmp \>= 5 to avoid timing attack vulnerability.’, PowmInsecureWarning)” }
