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

Module not found error - "recurring_ical_events" #329

Closed
lothar-mar opened this issue Aug 12, 2023 · 12 comments
Closed

Module not found error - "recurring_ical_events" #329

lothar-mar opened this issue Aug 12, 2023 · 12 comments

Comments

@lothar-mar
Copy link

As mentioned in the title, i get this error when running "test_caldav.py" and "test_caldav_unit.py":

FAILED tests/test_caldav.py::TestLocalRadicale::testTodoDatesearch - ModuleNotFoundError: No module named 'recurring_ical_events'
FAILED tests/test_caldav.py::TestLocalRadicale::testRecurringDateSearch - ModuleNotFoundError: No module named 'recurring_ical_events'
FAILED tests/test_caldav_unit.py::TestExpandRRule::testZero - ModuleNotFoundError: No module named 'recurring_ical_events'
FAILED tests/test_caldav_unit.py::TestExpandRRule::testOne - ModuleNotFoundError: No module named 'recurring_ical_events'
FAILED tests/test_caldav_unit.py::TestExpandRRule::testThree - ModuleNotFoundError: No module named 'recurring_ical_events'
FAILED tests/test_caldav_unit.py::TestExpandRRule::testThreeTodo - ModuleNotFoundError: No module named 'recurring_ical_events'
FAILED tests/test_caldav_unit.py::TestExpandRRule::testSplit - ModuleNotFoundError: No module named 'recurring_ical_events'
FAILED tests/test_caldav_unit.py::TestExpandRRule::test241 - ModuleNotFoundError: No module named 'recurring_ical_events'

AM I missing some dependencies perhaps?

@tobixen
Copy link
Member

tobixen commented Aug 12, 2023

Yes, recurring-ical-events is listed as dependency in setup.py.

@daniele-athome
Copy link
Contributor

daniele-athome commented Feb 11, 2025

I'll take the liberty of recycling this issue because the title of my bug would be identical :-)

Traceback (most recent call last):
   File "/home/homeassistant/hass/lib/python3.13/site-packages/homeassistant/helpers/update_coordinator.py>
     self.data = await self._async_update_data()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/homeassistant/hass/lib/python3.13/site-packages/homeassistant/components/caldav/coordinator>
     results = await self.hass.async_add_executor_job(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     ...<7 lines>...
     )
     ^
   File "/usr/lib/python3.13/concurrent/futures/thread.py", line 59, in run
     result = self.fn(*self.args, **self.kwargs)
   File "/home/homeassistant/hass/lib/python3.13/site-packages/caldav/objects.py", line 1105, in search
     o.expand_rrule(start, end)
     ~~~~~~~~~~~~~~^^^^^^^^^^^^
   File "/home/homeassistant/hass/lib/python3.13/site-packages/caldav/objects.py", line 1796, in expand_rr>
     import recurring_ical_events
 ModuleNotFoundError: No module named 'recurring_ical_events'

This is happening in Home Assistant, caldav integration, with both python-caldav 1.3.9 and 1.4.0. I'm guessing it has something to do with this item in this changelog:

Restructure module into package with a file structure.

That is, the directory recurring_ical_events doesn't exist anymore in my Python installation - I'm not really sure what is happening here though.

EDIT: rolling back recurring_ical_events to 3.4.1 fixes the problem.

@tobixen
Copy link
Member

tobixen commented Feb 12, 2025

Ouch. Which version of the recurring_ical_events is used in your homeassistant installation?

@daniele-athome
Copy link
Contributor

The latest, version 3.5.0.

@tobixen
Copy link
Member

tobixen commented Feb 12, 2025

3.5.0 was released yesterday. I'll try and run the test code and see if I can reproduce it locally

@daniele-athome
Copy link
Contributor

daniele-athome commented Feb 12, 2025

Indeed, yesterday I recreated my virtualenv and reinstalled Home Assistant, so pure bad luck :-)

EDIT: and also recurring_ical_events not properly using semver probably?

@tobixen
Copy link
Member

tobixen commented Feb 12, 2025

That would surprise me, @niccokunzmann seems to be pretty clever at such things.

@tobixen
Copy link
Member

tobixen commented Feb 12, 2025

I didn't check 3.5.0 specifically, but with the HEAD of the master branch at my laptop, there are no problems running the caldav test code.

@daniele-athome
Copy link
Contributor

daniele-athome commented Feb 12, 2025

A simple reproducible case would be this (which I just tried):

python3 -m venv .venv
source .venv/bin/activate
pip3 install recurring-ical-events
python3
>> import recurring_ical_events
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    import recurring_ical_events
ModuleNotFoundError: No module named 'recurring_ical_events'

Apparently no Python source file of recurring_ical_events ever appeared in the venv. Am I doing something wrong?

ls -l .venv/lib/python3.13/site-packages
totale 104
drwxrwxr-x 3 daniele daniele  4096 12 feb 11.46 click
drwxrwxr-x 2 daniele daniele  4096 12 feb 11.46 click-8.1.8.dist-info
drwxrwxr-x 6 daniele daniele  4096 12 feb 11.46 dateutil
drwxrwxr-x 5 daniele daniele  4096 12 feb 11.46 icalendar
drwxrwxr-x 3 daniele daniele  4096 12 feb 11.46 icalendar-6.1.1.dist-info
drwxrwxr-x 5 daniele daniele  4096 12 feb 11.45 pip
drwxrwxr-x 2 daniele daniele  4096 12 feb 11.45 pip-25.0.dist-info
drwxrwxr-x 2 daniele daniele  4096 12 feb 11.46 __pycache__
drwxrwxr-x 2 daniele daniele  4096 12 feb 11.46 python_dateutil-2.9.0.post0.dist-info
drwxrwxr-x 2 daniele daniele  4096 12 feb 11.46 recurring_ical_events-3.5.0.dist-info
drwxrwxr-x 2 daniele daniele  4096 12 feb 11.46 six-1.17.0.dist-info
-rw-rw-r-- 1 daniele daniele 34703 12 feb 11.46 six.py
drwxrwxr-x 4 daniele daniele  4096 12 feb 11.46 tzdata
drwxrwxr-x 2 daniele daniele  4096 12 feb 11.46 tzdata-2025.1.dist-info
drwxrwxr-x 2 daniele daniele  4096 12 feb 11.46 x_wr_timezone-2.0.1.dist-info
-rw-rw-r-- 1 daniele daniele  8569 12 feb 11.46 x_wr_timezone.py

There is only the dist-info directory.

EDIT: maybe I need to open a bug to recurring_ical_events, it seems like a packaging issue.

@tobixen
Copy link
Member

tobixen commented Feb 12, 2025

In the "classic" system-wide configuration I wasn't able to reproduce, and using venv all caldav tests passed - but the recurring_ical_events is lazily loaded when needed rather than immediately when loading the caldav library, the tests are probably running only towards xandikos on a plain venv, xandikos does not support recurrences, hence all tests involving recurrences are skipped. I can indeed reproduce the issue, being unable to load recurring_ical_events from a plain venv.

And yes, since the bug is reproducible without involving the caldav library, it would be more approriate to file it under the recurring_ical_event project :-) https://github.com/niccokunzmann/python-recurring-ical-events

@daniele-athome
Copy link
Contributor

daniele-athome commented Feb 12, 2025

Thanks for the support! Opened niccokunzmann/python-recurring-ical-events#214

If indeed it is a packaging problem and a new version will be released to fix this, I would suggest you put an exclusion of version 3.5.0 in your dependencies.

@niccokunzmann
Copy link

Sorry for the inconvenience! I will delete the release once there is a fix. Then, you do not need to add an exception.

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

4 participants