Traceback with ansible: AttributeError: 'module' object has no attribute '_vendor'

2,588 views
Skip to first unread message

tma...@gmail.com

unread,
Sep 22, 2015, 10:52:41 AM9/22/15
to Ansible Project
Hi all. I hope you can help me investigating the problem why my ansible installation does not want to run.
I get the following traceback in latest stable "release" as well as git checkout:

seadmin@aconf1a:/sw/ansible_gitclone/ansible/bin> ./ansible
Traceback (most recent call last):
  File "./ansible", line 40, in <module>
    from ansible.utils.display import Display
  File "/sw/ansible/lib/ansible/utils/display.py", line 35, in <module>
    from ansible import constants as C
  File "/sw/ansible/lib/ansible/constants.py", line 30, in <module>
    from ansible.parsing.splitter import unquote
  File "/sw/ansible/lib/ansible/parsing/__init__.py", line 32, in <module>
    from ansible.parsing.vault import VaultLib
  File "/sw/ansible/lib/ansible/parsing/vault/__init__.py", line 53, in <module>
    from Crypto.Hash import SHA256, HMAC
  File "build/bdist.linux-x86_64/egg/Crypto/Hash/HMAC.py", line 66, in <module>
  File "build/bdist.linux-x86_64/egg/Crypto/Util/strxor.py", line 7, in <module>
  File "build/bdist.linux-x86_64/egg/Crypto/Util/strxor.py", line 3, in __bootstrap__
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 90, in <module>
AttributeError: 'module' object has no attribute '_vendor'

My older 2.0.0 ansible installation is running properly.

tma...@gmail.com

unread,
Sep 23, 2015, 11:50:02 AM9/23/15
to Ansible Project
This is fixed as hacking/env-setup or python setup.py egg_info was executed.

Anthony Green

unread,
Nov 6, 2015, 5:24:37 AM11/6/15
to Ansible Project


On Wednesday, 23 September 2015 16:50:02 UTC+1, tma...@gmail.com wrote:
This is fixed as hacking/env-setup or python setup.py egg_info was executed.
AttributeError: 'module' object has no attribute '_vendor'

I'm getting this error with v2.0.0-0.3.beta1 on OS X

 

Anthony Green

unread,
Nov 6, 2015, 5:43:47 AM11/6/15
to Ansible Project

In my case the fix was to uninstall the cryptography pip I previously installed

Srdjan Grubor

unread,
Jan 15, 2016, 3:05:42 PM1/15/16
to Ansible Project
I fixed this issue on my Ubuntu 15.10 machine by installing python-paramiko, python-selinux, and python-crypto

Try installing all dependencies from regular ansible package (apt-cache show ansible) - you might have some missing.

Toshio Kuratomi

unread,
Jan 15, 2016, 4:07:53 PM1/15/16
to ansible...@googlegroups.com
If you're encountering this with the PPAs, the 2.0.0.1
python-setuptools was missing as a dependency in the debs that we
built for the PPA. That can cause this error as well. The 2.0.0.2 PPA
build should have fixed that problem.

-Toshio
> --
> 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-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/89fbe424-4247-4138-af5d-db02a64b08a0%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Pablo Daniel Estigarribia Davyt

unread,
Jan 20, 2016, 7:22:57 PM1/20/16
to Ansible Project
Hello,

I had similar error:

ansible
Unexpected Exception: 'module' object has no attribute '_init_cffi_1_0_external_module'
the full traceback was:


Traceback (most recent call last):
  File "/home/pablo/setup/ansible/bin/ansible", line 74, in <module>
    from ansible.cli.adhoc import AdHocCLI as mycli
  File "/home/pablo/setup/ansible/lib/ansible/cli/adhoc.py", line 28, in <module>
    from ansible.executor.task_queue_manager import TaskQueueManager
  File "/home/pablo/setup/ansible/lib/ansible/executor/task_queue_manager.py", line 29, in <module>
    from ansible.executor.play_iterator import PlayIterator
  File "/home/pablo/setup/ansible/lib/ansible/executor/play_iterator.py", line 29, in <module>
    from ansible.playbook.block import Block
  File "/home/pablo/setup/ansible/lib/ansible/playbook/__init__.py", line 25, in <module>
    from ansible.playbook.play import Play
  File "/home/pablo/setup/ansible/lib/ansible/playbook/play.py", line 27, in <module>
    from ansible.playbook.base import Base
  File "/home/pablo/setup/ansible/lib/ansible/playbook/base.py", line 35, in <module>
    from ansible.parsing.dataloader import DataLoader
  File "/home/pablo/setup/ansible/lib/ansible/parsing/dataloader.py", line 33, in <module>
    from ansible.parsing.vault import VaultLib
  File "/home/pablo/setup/ansible/lib/ansible/parsing/vault/__init__.py", line 68, in <module>
    from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
  File "/usr/lib64/python2.7/site-packages/cryptography/hazmat/primitives/kdf/pbkdf2.py", line 12, in <module>
    from cryptography.hazmat.primitives import constant_time
  File "/usr/lib64/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py", line 9, in <module>
    from cryptography.hazmat.bindings._constant_time import lib
AttributeError: 'module' object has no attribute '_init_cffi_1_0_external_module'


with all dependencies for ansible installed.

It was solved after removing: sudo dnf remove python-cryptography

it solved the issue immediatelly.

looks like there are some conflicts with python-crypt and python-cryptography.

Toshio Kuratomi

unread,
Jan 21, 2016, 11:09:02 AM1/21/16
to ansible...@googlegroups.com
Unfortunately, with setuptools in the mix it's just as likely that the
two python modules are compatible but when they're installed together
a setuptools bug triggers and causes things like this. setuptools
changes where python is searching for modules based on data installed
globally (all of the egginfo files of packages) so I can kind of see
how that can happen even though I can't see how this particular bug
works :-( On Ubuntu we found that even though the bug was experienced
by people with both PyCrypto and Cryptography installed the bug was
really that the setuptools egginfo wasn't installed.

-Toshio
> https://groups.google.com/d/msgid/ansible-project/a460af2c-f4e7-4edd-89d3-1d951c1109b0%40googlegroups.com.

Dan McCormick

unread,
Feb 15, 2016, 8:14:21 AM2/15/16
to Ansible Project
In case this helps someone who finds this thread while Googling, I was able to solve this on Mac OS X by installing the cryptography package system-wide, i.e. "sudo pip install cryptography".

Dan
Reply all
Reply to author
Forward
0 new messages