# pycrypto

**URL:** <https://forum.ansible.com/t/pycrypto/15896>\
**Category:** Ansible Project\
**Created:** [August 8, 2014, 6:43pm UTC](https://forum.ansible.com/t/pycrypto/15896 "2014-08-08T18:43:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![guanwen](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@guanwen](https://forum.ansible.com/u/guanwen)\
**Post date:** [August 8, 2014, 6:43pm UTC](https://forum.ansible.com/t/pycrypto/15896/1 "2014-08-08T18:43:28Z")

</div>

```auto
The OS is CentOS 6.5 64 bit.

```

```auto

Initial questions - what OS are you running from and how did you install
ansible?

```

```auto

Pycrypto can get confused when your libs get mixed between OS packages and
pip.

On Thu, Aug 7, 2014 at 5:46 PM, Guanwen Zhang <[guan...@ualberta.ca](mailto:guan...@ualberta.ca)> wrote:

>
> I installed ansible 1.7, when I played my playbook, I got the following
> error messages:
>
> [***@xxxx openstack]$ ansible-playbook -i ../inventory --ask-vault-pass
> keystone.yml
> Vault password:
> ERROR: ansible-vault requires a newer version of pycrypto than the one
> installed on your platform. You may fix this with OS-specific commands such
> as:
> yum install python-devel; rpm -e --nodeps python-crypto; pip install
> pycrypto
>
>
> I followed the above instruction, I got:
>
> pip install pycrypto --upgrade
> Requirement already up-to-date: pycrypto in
> /usr/lib64/python2.6/site-packages/pycrypto-2.6.1-py2.6-linux-x86_64.egg
> Cleaning up...
>
>
> However, the problem is not still there.
>
> regards
>
> Henry
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [ansible-project+unsubscr...@googlegroups.com](mailto:ansible-project%2Bunsubscr...@googlegroups.com).
> To post to this group, send email to [ansible-project@googlegroups.com](mailto:ansible-project@googlegroups.com).
> To view this discussion on the web visit
> [https://groups.google.com/d/msgid/ansible-project/CAKx6xESJfA9d7XMSmkWbJzdeP3DFQZYmoJujVn2kB-HWGsoukg%40mail.gmail.com](https://groups.google.com/d/msgid/ansible-project/CAKx6xESJfA9d7XMSmkWbJzdeP3DFQZYmoJujVn2kB-HWGsoukg%40mail.gmail.com)
> <[https://groups.google.com/d/msgid/ansible-project/CAKx6xESJfA9d7XMSmkWbJzdeP3DFQZYmoJujVn2kB-HWGsoukg%40mail.gmail.com?utm_medium=email&utm_source=footer](https://groups.google.com/d/msgid/ansible-project/CAKx6xESJfA9d7XMSmkWbJzdeP3DFQZYmoJujVn2kB-HWGsoukg%40mail.gmail.com?utm_medium=email&utm_source=footer)>
> .
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [ansible-project+unsubscr...@googlegroups.com](mailto:ansible-project%2Bunsubscr...@googlegroups.com).
To post to this group, send email to [ansible-project@googlegroups.com](mailto:ansible-project@googlegroups.com).
To view this discussion on the web visit 
[https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxWNV_D1srmOw41C12YWxmGFtHZ_sgjdcUo6janAs_qhw%40mail.gmail.com](https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxWNV_D1srmOw41C12YWxmGFtHZ_sgjdcUo6janAs_qhw%40mail.gmail.com).
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

```

---

<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:** [August 8, 2014, 11:21pm UTC](https://forum.ansible.com/t/pycrypto/15896/2 "2014-08-08T23:21:51Z")

</div>

Can you share how you installed Ansible as well?

---

<div class="post-metadata">

**Author:** ![Hoffmann\_Liu](https://avatars.discourse-cdn.com/v4/letter/h/b9e5f3/32.png) [@Hoffmann\_Liu](https://forum.ansible.com/u/Hoffmann_Liu)\
**Post date:** [August 9, 2014, 10:35am UTC](https://forum.ansible.com/t/pycrypto/15896/3 "2014-08-09T10:35:46Z")

</div>

I wonder if you have two or three different pythons on your managing host ?

I have 3 pythons and 1 pypy on my CentOS 5 managing host. You may need to be careful about what ansible, ansible-playbook really invoke. Joggling between various libgmp , pycrypto and python/pypys is a little tricky.

---

<div class="post-metadata">

**Author:** ![Joey](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@Joey](https://forum.ansible.com/u/Joey)\
**Post date:** [October 4, 2014, 12:05am UTC](https://forum.ansible.com/t/pycrypto/15896/4 "2014-10-04T00:05:10Z")

</div>

I’m having the same problem.

RHEL 6.5, ansible installed from “yum install ansible”.

Installed Packages  
Name : ansible  
Arch : noarch  
Version : 1.7  
Release : 1.el6

I was able to use vault to encrypt a group\_vars file, but it won’t unencrypt:

> `
> 
> # ansible linux-renderfarm -m ping --ask-vault-pass
> 
> Vault password:  
> ERROR: ansible-vault requires a newer version of pycrypto than the one installed on your platform. You may fix this with OS-specific commands such as: yum install python-devel; rpm -e --nodeps python-crypto; pip install pycrypto  
> `

Running the given commands:

> `Setting up Install Process Package python-devel-2.6.6-52.el6.x86_64 already installed and latest version Nothing to do error: package python-crypto is not installed Requirement already satisfied (use --upgrade to upgrade): pycrypto in /usr/lib64/python2.6/site-packages/pycrypto-2.6.1-py2.6-linux-x86_64.egg Cleaning up...`

Also did a “yum install python-crypto” afterwards, still has the same error message. Any ideas?

---

<div class="post-metadata">

**Author:** ![Joey](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@Joey](https://forum.ansible.com/u/Joey)\
**Post date:** [October 8, 2014, 6:11pm UTC](https://forum.ansible.com/t/pycrypto/15896/5 "2014-10-08T18:11:29Z")

</div>

More info:

ansible-vault encrypt/decrypt/edit all work. The only part that doesn’t work is using --ask-vault-pass from the command line.

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [October 9, 2014, 4:54am UTC](https://forum.ansible.com/t/pycrypto/15896/6 "2014-10-09T04:54:42Z")

</div>

Ah, rhel6 ships with a version of pycrypto that’s too old. There’s a forward compat python-crypto2.6 package in the epel6 repo. The ansible package shipped in epel6 has a patch to make use of that forward compat package. It’s possible the patch splits changes to ansible-vault but not to ansible-playbook. I can check on that for you after dinner.

-Toshio

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [October 9, 2014, 5:25am UTC](https://forum.ansible.com/t/pycrypto/15896/7 "2014-10-09T05:25:27Z")

</div>

> Ah, rhel6 ships with a version of pycrypto that's too old. There's a forward  
> compat python-crypto2.6 package in the epel6 repo. The ansible package  
> shipped in epel6 has a patch to make use of that forward compat package.  
> It's possible the patch splits changes to ansible-vault but not to  
> ansible-playbook. I can check on that for you after dinner.

s/ansible-playbook/ansible/ in the above and that's exactly what the  
issue turned out to be.

Since I have a foot in the door in the EPEL world as well, I've built  
new packages there:

[http://koji.fedoraproject.org/koji/buildinfo?buildID=583559](http://koji.fedoraproject.org/koji/buildinfo?buildID=583559)

You can download and yum or rpm install that rpm on your system to  
test that the fix works.

The packages will go through the normal EPEL process of being signed,  
and going to the epel-esting repository. Then, after approximately  
two weeks (sooner if enough people say the package works), the package  
will go to the EPEL6 stable repo. You can watch that here:  
[https://admin.fedoraproject.org/updates/ansible-1.7.2-2.el6](https://admin.fedoraproject.org/updates/ansible-1.7.2-2.el6)

-Toshio
