Hello,

You could also try and run the command without quotes 'which python' that 
will give you the path to the Python executable

Then run again without the quotes '/usr/bin/python --version' replacing the 
path with the one returned from the which command you ran before which will 
give you the python version.

Ansible afaik requires Python 2.7 so if the version of the system python is 
Python 3 you may want to symlink /usr/bin/python to the python2 executable.

Kind Regards

On Sunday, 27 November 2016 17:48:51 UTC, Simon Wydooghe wrote:
>
> I'm following the Developing Modules guide to get myself started with 
> Ansible hacking (
> http://docs.ansible.com/ansible/dev_guide/developing_modules.html).
>
> I've sourced hacking/env-setup and now I'm simply trying to use 
> test-module to test an original unedited module.
>
> The module I'm trying to test is 'virt', under extras/cloud/extra. It has 
> a python dependency: libvirt-python. This dependency has been installed and 
> I can open a Python terminal and import 'libvirt' without a problem.
>
> root@9ba2749b80b0:/code# python2
> Python 2.7.12 (default, Nov 17 2016, 22:18:11) 
> [GCC 4.9.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import libvirt
> >>> 
>
> However, when using test-module to test 'virt', it seems unable to import 
> 'libvirt':
>
> root@9ba2749b80b0:/code# hacking/test-module -m 
> lib/ansible/modules/extras/cloud/misc/virt.py 
> * including generated source, if any, saving to: 
> /root/.ansible_module_generated
> * ansiballz module detected; extracted module source to: /root/debug_dir
> ***********************************
> RAW OUTPUT
>
> {"msg": "The `libvirt` module is not importable. Check the requirements.", 
> "failed": true, "invocation": {"module_args": {"xml": null, "state": null, 
> "command": null, "name": null, "uri": "qemu:///system"}}}
>
>
> ***********************************
> PARSED OUTPUT
> {
>     "failed": true, 
>     "invocation": {
>         "module_args": {
>             "command": null, 
>             "name": null, 
>             "state": null, 
>             "uri": "qemu:///system", 
>             "xml": null
>         }
>     }, 
>     "msg": "The `libvirt` module is not importable. Check the 
> requirements."
> }
>
> I must be missing something here... Does anyone have a hint as to what 
> could be the problem?
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5ab6627f-8fa3-47e2-aac1-f6e242fbd845%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to