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

Kolibri 0.15.2 Python 3.10 error on Ubuntu 22.04 "ImportError: cannot import name 'Iterator' from 'collections' (/usr/lib/python3.10/collections/__init__.py)" #9392

Closed
holta opened this issue Apr 30, 2022 · 9 comments

Comments

@holta
Copy link

holta commented Apr 30, 2022

This promising work from earlier in April seemed tailored to getting Kolibri 0.15.2 working with Python 3.10? [CLARIF: No, Kolibri seems to be deferring support for Python 3.10 until a later date]

Somehow however the just-released Kolibri 0.15.2 (https://learningequality.org/r/kolibri-deb-latest) appears to install on Ubuntu Desktop 22.04 on x86_64 (as part of Internet-in-a-Box) — but then serious Python 3.10 problems appear:

TASK [kolibri : Provision Kolibri, while setting: facility name, admin acnt / password, preset type, and language] *****************************************************
fatal: [127.0.0.1]: FAILED! => {"changed": true, "cmd": "export KOLIBRI_HOME=\"/library/kolibri\" && \"/usr/bin/kolibri\" manage provisiondevice --facility \"Kolibri-in-a-Box\" --superusername \"Admin\" --superuserpassword \"changeme\" --preset \"formal\" --language_id \"en\" #--preset \"formal\" --language_id \"en\" --verbosity 0 --noinput\n", "delta": "0:00:01.342052", "end": "2022-04-29 21:47:01.194557", "msg": "non-zero return code", "rc": 1, "start": "2022-04-29 21:46:59.852505", "stderr": "INFO: No C extensions are available for this platform\nTraceback (most recent call last):\n  File \"/usr/bin/kolibri\", line 11, in <module>\n    load_entry_point('kolibri==0.15.2', 'console_scripts', 'kolibri')()\n  File \"/usr/lib/python3/dist-packages/pkg_resources/__init__.py\", line 479, in load_entry_point\n    return get_distribution(dist).load_entry_point(group, name)\n  File \"/usr/lib/python3/dist-packages/pkg_resources/__init__.py\", line 2861, in load_entry_point\n    return ep.load()\n  File \"/usr/lib/python3/dist-packages/pkg_resources/__init__.py\", line 2465, in load\n    return self.resolve()\n  File \"/usr/lib/python3/dist-packages/pkg_resources/__init__.py\", line 2471, in resolve\n    module = __import__(self.module_name, fromlist=['__name__'], level=0)\n  File \"/usr/lib/python3/dist-packages/kolibri/utils/cli.py\", line 12, in <module>\n    from django.core.management import execute_from_command_line\n  File \"/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/__init__.py\", line 13, in <module>\n    from django.core.management.base import (\n  File \"/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/base.py\", line 17, in <module>\n    from django.db.migrations.exceptions import MigrationSchemaMissing\n  File \"/usr/lib/python3/dist-packages/kolibri/dist/django/db/migrations/__init__.py\", line 2, in <module>\n    from .operations import *  # NOQA\n  File \"/usr/lib/python3/dist-packages/kolibri/dist/django/db/migrations/operations/__init__.py\", line 1, in <module>\n    from .fields import AddField, AlterField, RemoveField, RenameField\n  File \"/usr/lib/python3/dist-packages/kolibri/dist/django/db/migrations/operations/fields.py\", line 4, in <module>\n    from django.db.models.fields import NOT_PROVIDED\n  File \"/usr/lib/python3/dist-packages/kolibri/dist/django/db/models/__init__.py\", line 5, in <module>\n    from django.db.models.deletion import (\n  File \"/usr/lib/python3/dist-packages/kolibri/dist/django/db/models/deletion.py\", line 5, in <module>\n    from django.db.models import signals, sql\n  File \"/usr/lib/python3/dist-packages/kolibri/dist/django/db/models/sql/__init__.py\", line 2, in <module>\n    from django.db.models.sql.query import *  # NOQA\n  File \"/usr/lib/python3/dist-packages/kolibri/dist/django/db/models/sql/query.py\", line 11, in <module>\n    from collections import Counter, Iterator, Mapping, OrderedDict\nImportError: cannot import name 'Iterator' from 'collections' (/usr/lib/python3.10/collections/__init__.py)", "stderr_lines": ["INFO: No C extensions are available for this platform", "Traceback (most recent call last):", "  File \"/usr/bin/kolibri\", line 11, in <module>", "    load_entry_point('kolibri==0.15.2', 'console_scripts', 'kolibri')()", "  File \"/usr/lib/python3/dist-packages/pkg_resources/__init__.py\", line 479, in load_entry_point", "    return get_distribution(dist).load_entry_point(group, name)", "  File \"/usr/lib/python3/dist-packages/pkg_resources/__init__.py\", line 2861, in load_entry_point", "    return ep.load()", "  File \"/usr/lib/python3/dist-packages/pkg_resources/__init__.py\", line 2465, in load", "    return self.resolve()", "  File \"/usr/lib/python3/dist-packages/pkg_resources/__init__.py\", line 2471, in resolve", "    module = __import__(self.module_name, fromlist=['__name__'], level=0)", "  File \"/usr/lib/python3/dist-packages/kolibri/utils/cli.py\", line 12, in <module>", "    from django.core.management import execute_from_command_line", "  File \"/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/__init__.py\", line 13, in <module>", "    from django.core.management.base import (", "  File \"/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/base.py\", line 17, in <module>", "    from django.db.migrations.exceptions import MigrationSchemaMissing", "  File \"/usr/lib/python3/dist-packages/kolibri/dist/django/db/migrations/__init__.py\", line 2, in <module>", "    from .operations import *  # NOQA", "  File \"/usr/lib/python3/dist-packages/kolibri/dist/django/db/migrations/operations/__init__.py\", line 1, in <module>", "    from .fields import AddField, AlterField, RemoveField, RenameField", "  File \"/usr/lib/python3/dist-packages/kolibri/dist/django/db/migrations/operations/fields.py\", line 4, in <module>", "    from django.db.models.fields import NOT_PROVIDED", "  File \"/usr/lib/python3/dist-packages/kolibri/dist/django/db/models/__init__.py\", line 5, in <module>", "    from django.db.models.deletion import (", "  File \"/usr/lib/python3/dist-packages/kolibri/dist/django/db/models/deletion.py\", line 5, in <module>", "    from django.db.models import signals, sql", "  File \"/usr/lib/python3/dist-packages/kolibri/dist/django/db/models/sql/__init__.py\", line 2, in <module>", "    from django.db.models.sql.query import *  # NOQA", "  File \"/usr/lib/python3/dist-packages/kolibri/dist/django/db/models/sql/query.py\", line 11, in <module>", "    from collections import Counter, Iterator, Mapping, OrderedDict", "ImportError: cannot import name 'Iterator' from 'collections' (/usr/lib/python3.10/collections/__init__.py)"], "stdout": "", "stdout_lines": []}

Likewise systemctl start kolibri fails, leading to this systemctl status kolibri output/trace:

Apr 29 21:55:00 box kolibri[3985]: INFO: No C extensions are available for this platform
Apr 29 21:55:01 box kolibri[3985]: Traceback (most recent call last):
Apr 29 21:55:01 box kolibri[3985]:   File "/usr/bin/kolibri", line 11, in <module>
Apr 29 21:55:01 box kolibri[3985]:     load_entry_point('kolibri==0.15.2', 'console_scripts', 'kolibri')()
Apr 29 21:55:01 box kolibri[3985]:   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 479, in load_entry_point
Apr 29 21:55:01 box kolibri[3985]:     return get_distribution(dist).load_entry_point(group, name)
Apr 29 21:55:01 box kolibri[3985]:   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2861, in load_entry_point
Apr 29 21:55:01 box kolibri[3985]:     return ep.load()
Apr 29 21:55:01 box kolibri[3985]:   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2465, in load
Apr 29 21:55:01 box kolibri[3985]:     return self.resolve()
Apr 29 21:55:01 box kolibri[3985]:   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2471, in resolve
Apr 29 21:55:01 box kolibri[3985]:     module = __import__(self.module_name, fromlist=['__name__'], level=0)
Apr 29 21:55:01 box kolibri[3985]:   File "/usr/lib/python3/dist-packages/kolibri/utils/cli.py", line 12, in <module>
Apr 29 21:55:01 box kolibri[3985]:     from django.core.management import execute_from_command_line
Apr 29 21:55:01 box kolibri[3985]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/__init__.py", line 13, in <module>
Apr 29 21:55:01 box kolibri[3985]:     from django.core.management.base import (
Apr 29 21:55:01 box kolibri[3985]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/base.py", line 17, in <module>
Apr 29 21:55:01 box kolibri[3985]:     from django.db.migrations.exceptions import MigrationSchemaMissing
Apr 29 21:55:01 box kolibri[3985]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/db/migrations/__init__.py", line 2, in <module>
Apr 29 21:55:01 box kolibri[3985]:     from .operations import *  # NOQA
Apr 29 21:55:01 box kolibri[3985]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/db/migrations/operations/__init__.py", line 1, in <module>
Apr 29 21:55:01 box kolibri[3985]:     from .fields import AddField, AlterField, RemoveField, RenameField
Apr 29 21:55:01 box kolibri[3985]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/db/migrations/operations/fields.py", line 4, in <module>
Apr 29 21:55:01 box kolibri[3985]:     from django.db.models.fields import NOT_PROVIDED
Apr 29 21:55:01 box kolibri[3985]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/db/models/__init__.py", line 5, in <module>
Apr 29 21:55:01 box kolibri[3985]:     from django.db.models.deletion import (
Apr 29 21:55:01 box kolibri[3985]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/db/models/deletion.py", line 5, in <module>
Apr 29 21:55:01 box kolibri[3985]:     from django.db.models import signals, sql
Apr 29 21:55:01 box kolibri[3985]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/db/models/sql/__init__.py", line 2, in <module>
Apr 29 21:55:01 box kolibri[3985]:     from django.db.models.sql.query import *  # NOQA
Apr 29 21:55:01 box kolibri[3985]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/db/models/sql/query.py", line 11, in <module>
Apr 29 21:55:01 box kolibri[3985]:     from collections import Counter, Iterator, Mapping, OrderedDict
Apr 29 21:55:01 box kolibri[3985]: ImportError: cannot import name 'Iterator' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
Apr 29 21:55:01 box systemd[1]: kolibri.service: Control process exited, code=exited, status=1/FAILURE
Apr 29 21:55:01 box systemd[1]: kolibri.service: Failed with result 'exit-code'.
Apr 29 21:55:01 box systemd[1]: Failed to start Kolibri.

Any suggestions?

Thanks if possible!

Earlier/Stale references to this same topic:

@holta
Copy link
Author

holta commented Apr 30, 2022

Or is it the case that Ubuntu 22.04 LTS (Python 3.10) users need to wait for Kolibri 0.16.0 — around the end of 2022 possibly?

@rtibbles
Copy link
Member

rtibbles commented May 2, 2022

Seems like this should be possible within the scope of 0.15.x - the above targeted PR should be able to make 0.15.3 onwards compatible with Python 3.10.

@rtibbles
Copy link
Member

rtibbles commented May 3, 2022

Closing this issue - the fix (and python 3.10 support) will be released in 0.15.3.

@rtibbles rtibbles closed this as completed May 3, 2022
@holta
Copy link
Author

holta commented May 3, 2022

Closing this issue - the fix (and python 3.10 support) will be released in 0.15.3.

Great news, Thanks @rtibbles & @jredrejo !

@holta
Copy link
Author

holta commented May 5, 2022

@marcellamaki would you happen to know if 0.15.3 is expected in May, June, or July — for communities that use Ubuntu 22.04 and need Python 3.10 support?

@rtibbles
Copy link
Member

rtibbles commented May 5, 2022

We are currently doing planned patches on 6 week release cycles - so the patch release including this should come at the beginning of June.

@holta
Copy link
Author

holta commented May 5, 2022

We are currently doing planned patches on 6 week release cycles - so the patch release including this should come at the beginning of June.

Great news, Thanks!

@holta
Copy link
Author

holta commented Jun 7, 2022

Confirmed: Kolibri 0.15.3 now works on Ubuntu 22.04 (and Python 3.10) with https://internet-in-a-box.org

(And hopefully 0.15.3 will be posted to https://learningequality.org/download/ shortly, to mainline this for others!)

@radinamatic
Copy link
Member

(And hopefully 0.15.3 will be posted to https://learningequality.org/download/ shortly, to mainline this for others!)

Done & done! 🙂

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

3 participants