Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named six - with Ansible 2.4 #12

Open
rabin-io opened this issue Oct 2, 2017 · 7 comments
Open

ImportError: No module named six - with Ansible 2.4 #12

rabin-io opened this issue Oct 2, 2017 · 7 comments

Comments

@rabin-io
Copy link
Contributor

rabin-io commented Oct 2, 2017

Seems like it's related to Ansible version, I get this error message with Ansible 2.4,
but can still work with version 2.3.

Error running cluster playbook:
Traceback (most recent call last):
  File "/usr/bin/vagrant-playbook", line 11, in <module>
    load_entry_point('vagrant-playbook==0.7.3', 'console_scripts', 'vagrant-playbook')()
  File "/usr/lib/python2.7/site-packages/vagrantplaybook/__main__.py", line 22, in main
    from vagrantplaybook.playbook.executor import Executor
  File "/usr/lib/python2.7/site-packages/vagrantplaybook/playbook/executor.py", line 9, in <module>
    from vagrantplaybook.ansible import ansible_unwrap, ansible_loader
  File "/usr/lib/python2.7/site-packages/vagrantplaybook/ansible.py", line 9, in <module>
    from vagrantplaybook.compat import compat_text_type
  File "/usr/lib/python2.7/site-packages/vagrantplaybook/compat.py", line 6, in <module>
    from ansible.compat.six import string_types, text_type, integer_types
ImportError: No module named six

I checked and I have the six package installed , I even tried to install it from pip and it didn't help.

# rpm -qa | grep python | grep six
python2-six-1.10.0-9.fc26.noarch
python3-six-1.10.0-9.fc26.noarch
# pip list | grep six
six (1.11.0)

edit:
OK, I when over my upgrade history, and I see that Ansible was upgraded to version 2.4,
checking the plugin source code I see this lines,

# /usr/lib/python2.7/site-packages/vagrantplaybook/compat.py
...
#TODO: remove dependencies from ansible
from ansible.compat.six import string_types, text_type, integer_types
...

seems like others have problem with this: ansible/ansible#24628

@rabin-io rabin-io changed the title ImportError: No module named six ImportError: No module named six - with Ansible 2.4 Oct 2, 2017
@rabin-io
Copy link
Contributor Author

Hello @fabriziopandini any chance you can give this issue some attention ?

@gregorydulin
Copy link

Running into this on RHEL7 too (ansible 2.4 hit the extras repo recently)

Did yum install python-six manually, but I still get the error.

rpm -qa | grep python | grep six
python-six-1.9.0-2.el7.noarch
rpm -qa | grep ansible
ansible-2.4.0.0-5.el7.noarch

@rabin-io
Copy link
Contributor Author

rabin-io commented Nov 2, 2017

can this issue get any attention ? I like to be able to start using Ansible 2.4 in my current work-flow, and this bug is a blocker for me. I'm thinking to stop using it and the vagrant-compose plugin all together.

ps ... I did a small test and it seems like you can change the import to use six package and not the one which came with ansible, and it will work.

--- a/usr/lib/python2.7/site-packages/vagrantplaybook/compat.py  2017-10-02 12:07:26.993066006 +0300
+++ b/usr/lib/python2.7/site-packages/vagrantplaybook/compat.py  2017-11-02 17:23:55.177159181 +0200
@@ -3,7 +3,7 @@
 __metaclass__ = type 
 
 #TODO: remove dependencies from ansible
-from ansible.compat.six import string_types, text_type, integer_types
+from six import string_types, text_type, integer_types
 
 compat_string_types = string_types
 compat_text_type = text_type

@fabriziopandini
Copy link
Owner

@rabin-io sorry for the long time in the answer
Unfortunately it seem that ansible went through a deep re-enginering and this is not easy to address.
Basically my intention here is to remove the dependency on ansible in order to avoid similar problems in future. As you can understand this is not easy.
If for you is acceptable to remove the ansible dependencies only partially I will quickly test your last suggestion and merge the changes asap. Let me know

@rabin-io
Copy link
Contributor Author

rabin-io commented Nov 2, 2017

Hi @fabriziopandini , long time no see :)

I'm currently running vagrant-playbook with the above patch, and it seems to work.
the only other problem I see is the deprecation message which i all ready mention in issue #11

@fabriziopandini
Copy link
Owner

fabriziopandini commented Nov 2, 2017

I just published release 0.7.4. that fixes this one (thanks for the suggestion 👍 ).
Please check and confirm that we can close this one.

I'll try to get out of the way #11 soon as well

@rabin-io
Copy link
Contributor Author

rabin-io commented Nov 2, 2017

Thanks for the quick reply, as for me i just updated to version 0.7.5 ... is that right ??

ip install -U --no-deps vagrant-playbook
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip install --user` instead.
Collecting vagrant-playbook
  Using cached vagrant-playbook-0.7.5.tar.gz
Installing collected packages: vagrant-playbook
  Found existing installation: vagrant-playbook 0.7.3
    Uninstalling vagrant-playbook-0.7.3:
      Successfully uninstalled vagrant-playbook-0.7.3
  Running setup.py install for vagrant-playbook ... done
Successfully installed vagrant-playbook-0.7.5

any way, it seems to work.

@gregorydulin can you confirm as well ?

@rabin-io rabin-io closed this as completed Nov 2, 2017
@rabin-io rabin-io reopened this Nov 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants