Mapping' from 'collections'

672 views
Skip to first unread message

naj...@gmail.com

unread,
Sep 17, 2022, 12:44:20 PM9/17/22
to rapidpro-dev

Hello everyone; I am trying to setup rapidpro 7.4.2 but having issue with python manage.py migrate; any solution?

ImportError: cannot import name 'Mapping' from 'collections'

here is the building process below; 

➜ rapidpro git:(main) ✗ docker-compose build

[+] Building 315.4s (11/11) FINISHED

=> [internal] load build definition from Dockerfile 0.0s

=> => transferring dockerfile: 32B 0.0s

=> [internal] load .dockerignore 0.0s

=> => transferring context: 2B 0.0s

=> [internal] load metadata for docker.io/fnndsc/python-poetry:1.1.14 0.0s

=> [internal] load build context 0.4s

=> => transferring context: 214.70kB 0.4s

=> CACHED [1/7] FROM docker.io/fnndsc/python-poetry:1.1.14 0.0s

=> [2/7] COPY . /code 7.1s

=> [3/7] WORKDIR /code 0.0s

=> [4/7] RUN apt-get update && apt-get install -y binutils libproj-dev gdal-bin 73.1s

=> [5/7] RUN pip install urllib3 1.2s

=> [6/7] RUN poetry install 230.1s

=> ERROR [7/7] RUN python manage.py migrate 3.2s

------

> [7/7] RUN python manage.py migrate:

#0 2.752 /opt/conda/lib/python3.10/site-packages/telegram/utils/request.py:40: UserWarning: python-telegram-bot wasn't properly installed. Please refer to README.rst on how to properly install.

#0 2.752 warnings.warn("python-telegram-bot wasn't properly installed. Please refer to README.rst on "

#0 2.754 Traceback (most recent call last):

#0 2.754 File "/code/manage.py", line 9, in <module>

#0 2.754 execute_from_command_line(sys.argv)

#0 2.754 File "/opt/conda/lib/python3.10/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line

#0 2.755 utility.execute()

#0 2.755 File "/opt/conda/lib/python3.10/site-packages/django/core/management/__init__.py", line 440, in execute

#0 2.755 self.fetch_command(subcommand).run_from_argv(self.argv)

#0 2.756 File "/opt/conda/lib/python3.10/site-packages/django/core/management/base.py", line 414, in run_from_argv

#0 2.756 self.execute(*args, **cmd_options)

#0 2.756 File "/opt/conda/lib/python3.10/site-packages/django/core/management/base.py", line 460, in execute

#0 2.757 output = self.handle(*args, **options)

#0 2.757 File "/opt/conda/lib/python3.10/site-packages/django/core/management/base.py", line 98, in wrapped

#0 2.757 res = handle_func(*args, **kwargs)

#0 2.757 File "/opt/conda/lib/python3.10/site-packages/django/core/management/commands/migrate.py", line 91, in handle

#0 2.757 self.check(databases=[database])

#0 2.757 File "/opt/conda/lib/python3.10/site-packages/django/core/management/base.py", line 487, in check

#0 2.757 all_issues = checks.run_checks(

#0 2.757 File "/opt/conda/lib/python3.10/site-packages/django/core/checks/registry.py", line 88, in run_checks

#0 2.758 new_errors = check(app_configs=app_configs, databases=databases)

#0 2.758 File "/opt/conda/lib/python3.10/site-packages/django/core/checks/urls.py", line 14, in check_url_config

#0 2.758 return check_resolver(resolver)

#0 2.758 File "/opt/conda/lib/python3.10/site-packages/django/core/checks/urls.py", line 24, in check_resolver

#0 2.758 return check_method()

#0 2.758 File "/opt/conda/lib/python3.10/site-packages/django/urls/resolvers.py", line 480, in check

#0 2.759 for pattern in self.url_patterns:

#0 2.759 File "/opt/conda/lib/python3.10/site-packages/django/utils/functional.py", line 49, in __get__

#0 2.759 res = instance.__dict__[self.name] = self.func(instance)

#0 2.759 File "/opt/conda/lib/python3.10/site-packages/django/urls/resolvers.py", line 696, in url_patterns

#0 2.759 patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)

#0 2.759 File "/opt/conda/lib/python3.10/site-packages/django/utils/functional.py", line 49, in __get__

#0 2.759 res = instance.__dict__[self.name] = self.func(instance)

#0 2.760 File "/opt/conda/lib/python3.10/site-packages/django/urls/resolvers.py", line 689, in urlconf_module

#0 2.760 return import_module(self.urlconf_name)

#0 2.760 File "/opt/conda/lib/python3.10/importlib/__init__.py", line 126, in import_module

#0 2.760 return _bootstrap._gcd_import(name[level:], package, level)

#0 2.760 File "<frozen importlib._bootstrap>", line 1050, in _gcd_import

#0 2.761 File "<frozen importlib._bootstrap>", line 1027, in _find_and_load

#0 2.761 File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked

#0 2.761 File "<frozen importlib._bootstrap>", line 688, in _load_unlocked

#0 2.761 File "<frozen importlib._bootstrap_external>", line 883, in exec_module

#0 2.761 File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed

#0 2.761 File "/code/temba/urls.py", line 19, in <module>

#0 2.762 re_path(r"^", include("temba.channels.urls")),

#0 2.762 File "/opt/conda/lib/python3.10/site-packages/django/urls/conf.py", line 38, in include

#0 2.762 urlconf_module = import_module(urlconf_module)

#0 2.762 File "/opt/conda/lib/python3.10/importlib/__init__.py", line 126, in import_module

#0 2.762 return _bootstrap._gcd_import(name[level:], package, level)

#0 2.762 File "<frozen importlib._bootstrap>", line 1050, in _gcd_import

#0 2.762 File "<frozen importlib._bootstrap>", line 1027, in _find_and_load

#0 2.763 File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked

#0 2.763 File "<frozen importlib._bootstrap>", line 688, in _load_unlocked

#0 2.764 File "<frozen importlib._bootstrap_external>", line 883, in exec_module

#0 2.764 File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed

#0 2.764 File "/code/temba/channels/urls.py", line 13, in <module>

#0 2.764 for ch_type in Channel.get_types():

#0 2.765 File "/code/temba/channels/models.py", line 501, in get_types

#0 2.765 from .types import TYPES

#0 2.766 File "/code/temba/channels/types/__init__.py", line 29, in <module>

#0 2.766 reload_channel_types()

#0 2.766 File "/code/temba/channels/types/__init__.py", line 26, in reload_channel_types

#0 2.766 register_channel_type(import_string(class_name))

#0 2.766 File "/opt/conda/lib/python3.10/site-packages/django/utils/module_loading.py", line 30, in import_string

#0 2.767 return cached_import(module_path, class_name)

#0 2.767 File "/opt/conda/lib/python3.10/site-packages/django/utils/module_loading.py", line 15, in cached_import

#0 2.767 import_module(module_path)

#0 2.767 File "/opt/conda/lib/python3.10/importlib/__init__.py", line 126, in import_module

#0 2.767 return _bootstrap._gcd_import(name[level:], package, level)

#0 2.767 File "/code/temba/channels/types/telegram/__init__.py", line 1, in <module>

#0 2.767 from .type import TelegramType # noqa

#0 2.767 File "/code/temba/channels/types/telegram/type.py", line 1, in <module>

#0 2.768 import telegram

#0 2.768 File "/opt/conda/lib/python3.10/site-packages/telegram/__init__.py", line 101, in <module>

#0 2.768 from .bot import Bot

#0 2.768 File "/opt/conda/lib/python3.10/site-packages/telegram/bot.py", line 42, in <module>

#0 2.768 from telegram.utils.request import Request

#0 2.768 File "/opt/conda/lib/python3.10/site-packages/telegram/utils/request.py", line 35, in <module>

#0 2.769 import telegram.vendor.ptb_urllib3.urllib3 as urllib3

#0 2.769 File "/opt/conda/lib/python3.10/site-packages/telegram/vendor/ptb_urllib3/urllib3/__init__.py", line 7, in <module>

#0 2.769 from .connectionpool import (

#0 2.769 File "/opt/conda/lib/python3.10/site-packages/telegram/vendor/ptb_urllib3/urllib3/connectionpool.py", line 30, in <module>

#0 2.769 from .connection import (

#0 2.770 File "/opt/conda/lib/python3.10/site-packages/telegram/vendor/ptb_urllib3/urllib3/connection.py", line 39, in <module>

#0 2.770 from .util.ssl_ import (

#0 2.771 File "/opt/conda/lib/python3.10/site-packages/telegram/vendor/ptb_urllib3/urllib3/util/__init__.py", line 3, in <module>

#0 2.771 from .connection import is_connection_dropped

#0 2.771 File "/opt/conda/lib/python3.10/site-packages/telegram/vendor/ptb_urllib3/urllib3/util/connection.py", line 3, in <module>

#0 2.771 from .wait import wait_for_read

#0 2.771 File "/opt/conda/lib/python3.10/site-packages/telegram/vendor/ptb_urllib3/urllib3/util/wait.py", line 1, in <module>

#0 2.772 from .selectors import (

#0 2.772 File "/opt/conda/lib/python3.10/site-packages/telegram/vendor/ptb_urllib3/urllib3/util/selectors.py", line 11, in <module>

#0 2.772 from collections import namedtuple, Mapping

#0 2.772 ImportError: cannot import name 'Mapping' from 'collections' (/opt/conda/lib/python3.10/collections/__init__.py)

------

failed to solve: executor failed running [/bin/sh -c python manage.py migrate]: exit code: 1


Regards,

N

Rowan Seymour

unread,
Sep 17, 2022, 4:33:09 PM9/17/22
to rapidpro-dev
That's a Python 3.9 vs 3.10 breaking change... we currently support 3.9

--
You received this message because you are subscribed to the Google Groups "rapidpro-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rapidpro-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rapidpro-dev/29321660-fd47-4dd3-9977-65bfe7e41b52n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages