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

ModuleNotFoundError: No module named 'ansible' #714

Closed
insanity54 opened this issue Sep 1, 2021 · 2 comments
Closed

ModuleNotFoundError: No module named 'ansible' #714

insanity54 opened this issue Sep 1, 2021 · 2 comments

Comments

@insanity54
Copy link

insanity54 commented Sep 1, 2021

I had some difficulties with semaphore v2.7.11 installed via snap (#713), so now I'm running I'm running semaphore v2.7.11 installed manually from https://github.com/ansible-semaphore/semaphore/releases

Before installing semaphore, I installed ansible using python -m pip install --user ansible. I can run ansible, ansible-playbook, ansible-inventory from my CLI. However, it looks like semaphore's venv(?) can't find the ansible python module.

8:16:17 AM Task 2 added to queue
8:16:21 AM Preparing: 2
8:16:21 AM Prepare task with template: immls provision
8:16:21 AM access key LEO-COMPUTE installed
8:16:21 AM Cloning repository https://github.com/****/****.git
8:16:21 AM Cloning into 'repository_1_1'...
8:16:23 AM access key LEO-COMPUTE installed
8:16:23 AM installing static inventory
8:16:23 AM No roles/requirements.yml file found. Skip galaxy install process.
8:16:23 AM Listing playbook hosts failed: exit status 1 Traceback (most recent call last): File "/home/chris/.local/bin/ansible-playbook", line 34, in <module> from ansible import context ModuleNotFoundError: No module named 'ansible' 
@fiftin
Copy link
Collaborator

fiftin commented Sep 1, 2021

I had same problem with --user too. I don't know why.

Can you try venv instead of --user?

python3 -m venv ~/my_py_venv
source ~/my_py_venv/bin/activate
pip3 install ansible
semaphore --config ~/config.json

@insanity54
Copy link
Author

Ah yep, that did the trick. I didn't even think to use a virtualenv for semaphore.

Many thanks

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

2 participants