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

No module named 'watchdog' error weh #609

Closed
3 tasks done
charlespick opened this issue Oct 27, 2023 · 4 comments · Fixed by #610
Closed
3 tasks done

No module named 'watchdog' error weh #609

charlespick opened this issue Oct 27, 2023 · 4 comments · Fixed by #610

Comments

@charlespick
Copy link

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that ansible-rulebook is open source software provided for free and that I might not receive a timely response.

Bug Summary

When following the instructions at main/docs/installation.rst, on a fresh installation of Ubuntu Server you get a traceback ending with no module named watchdog found. I followed the instructions to a tee and also got the same result on Fedora server although I am not as familiar with Fedora so that may be my fault who knows.
I searched for other issues with the keyword "watchdog" and found nothing but I apologize if this is a duplicate.

Environment

Ubuntu 22.04.3 LTS Server
openjdk 17 installed with apt
python 3.10.12 preinstalled
pip3 installed with apt

Steps to reproduce

Install Ubuntu

apt-get --assume-yes install openjdk-17-jdk python3-pip
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
export PATH=$PATH:~/.local/bin
pip3 install ansible ansible-rulebook ansible-runner

from the docs
ansible-rulebook

Actual results

Traceback (most recent call last):
  File "/home/charlespick/.local/bin/ansible-rulebook", line 5, in <module>
    from ansible_rulebook.cli import main
  File "/home/charlespick/.local/lib/python3.10/site-packages/ansible_rulebook/cli.py", line 35, in <module>
    from ansible_rulebook import app  # noqa: E402
  File "/home/charlespick/.local/lib/python3.10/site-packages/ansible_rulebook/app.py", line 32, in <module>
    from ansible_rulebook.engine import run_rulesets, start_source
  File "/home/charlespick/.local/lib/python3.10/site-packages/ansible_rulebook/engine.py", line 25, in <module>
    from watchdog.events import FileSystemEventHandler
ModuleNotFoundError: No module named 'watchdog'

Expected results

Help message or results when run with parameters and rulebook

Additional information

No response

@charlespick
Copy link
Author

I fixed this by injecting Watchdog manually. Is there a reason Watchdog isn't a dependency?

@ttuffin
Copy link
Contributor

ttuffin commented Oct 30, 2023

Hi @charlespick, if you have already installed the event-driven-ansible collection and still see this error then it's because the Python dependencies have not been installed. The watchdog library is a dependency for the ansible.eda collection and since ansible-galaxy doesn't handle the installation of Python dependencies they will need to be installed manually. We do include watchdog in the collection's requirements.txt and it is one of the steps included in the Install section for the collection.

Hope that helps.

@Alex-Izquierdo
Copy link
Contributor

Hi @charlespick @ttuffin This seems a bug introduced in #516
As our CI pipelines already install the collection which contains that dependency we have not detected the missing dependency. It is just a matter to add the dependency in the ansible-rulebook requirements.

Thanks for the report.

Alex-Izquierdo added a commit that referenced this issue Oct 30, 2023
Add a missing dependency required by
#516
Closes: #609
@Alex-Izquierdo
Copy link
Contributor

I expect to release 1.0.4 with this fix today or tomorrow as latest

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

Successfully merging a pull request may close this issue.

3 participants