Wiredcraft / dopy

Digital Ocean Python
MIT License
95 stars 62 forks source link

Drawing your attention to problems with dopy 0.3.7 on Mac OS X #41

Open davidjpeacock opened 8 years ago

davidjpeacock commented 8 years ago

:-)

https://github.com/ansible/ansible-modules-core/issues/2509

snoopdouglas commented 8 years ago

+1, still an issue for me.

From comments on ansible/ansible-modules-core#2509 - here's a temporary solution:

regentgal commented 8 years ago

This issue was resolved for me by upgrading to ansible 2.0.2.

snoopdouglas commented 8 years ago

@regentgal Running 2.0.2.0 here :(

kontrafiktion commented 8 years ago

Is this really a dopy issue? I have the same basic problem with dopy 0.3.5 (just with another error message). The basic problem as far as I can say is this: Ansible uses /opt/bin/python unless explicitly configured to use another Python interpreter. So even if you are running Ansible itself with another Python, when connecting (even to localhost) Ansible uses /opt/bin/python. Now the question becomes: "where" did you install dopy? In the import path for /usr/bin/python or in the import path for the Python you are using to start Ansible?

I just confirmed this by printing sys.executable from inside the digital_ocean Ansible module. Without setting ansible_python_interpreter the Python used was /opt/bin/python and I hadn't installed dopy into its import path.

So please check, which Python are using? Mine is either in a virtualenv or at /usr/local/bin (installed via HomeBrew)