Skip to content

Failed to import the required Python library on VM's Python /usr/bin/python #108

@TafkaMax

Description

@TafkaMax

Describe the bug

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named 'phpypam'

I am using Debian 12 and PIP is not allowed to install packages globally. Before I used pip install phpypam globally and it worked.

Now I have created a venv on the my ipam VM. When running my ansible-playbook from a controller node. I get this message, even though I try to set ansible_python_interpreter.

changing ansible_python_interprer the command 'which python' always returns /usr/bin/python on the ipam VM, instead of the venv python.

The flow of using ansible:

Controller (Uses Venv with ansible installed e.g. ~/git-repo/with-playbook/venv/bin/activate) -> IPAM VM ( Has /opt/docker_venv/bin/python that I set with the ansible_python_interpreter)

To Reproduce

I tried to change the python_interpreter to use different python version on the ipam VM. NB! the interpeter venv path is the one in the VM not in the controller. I am not sure how it works. which version of python it uses?

image

Expected behavior

Use correct venv.

Versions:

  • Ansible:
  • phpipam-ansible-modules:
  • phpypam:
  • phpIPAM:

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions