Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

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

Open
T-vK opened this issue Jul 11, 2023 · 0 comments
Open

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

T-vK opened this issue Jul 11, 2023 · 0 comments

Comments

@T-vK
Copy link

T-vK commented Jul 11, 2023

I can't seem to import the module.

This is how I installed it:

~ $ virtualenv funkapi
created virtual environment CPython3.11.2.final.0-64 in 753ms
  creator CPython3Posix(dest=/data/data/com.termux/files/home/funkapi, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/data/data/com.termux/files/home/.local/share/virtualenv)
    added seed packages: pip==23.1.2, setuptools==67.8.0, wheel==0.40.0
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
~ $ source funkapi/bin/activate
(funkapi) ~ $ pip3 install funkapi
Collecting funkapi
  Using cached funkapi-0.1.5-py3-none-any.whl (5.6 kB)
Collecting boto3==1.9.145 (from funkapi)
  Using cached boto3-1.9.145-py2.py3-none-any.whl (128 kB)
Collecting botocore==1.12.145 (from funkapi)
  Using cached botocore-1.12.145-py2.py3-none-any.whl (5.4 MB)
Collecting certifi==2019.3.9 (from funkapi)
  Using cached certifi-2019.3.9-py2.py3-none-any.whl (158 kB)
Collecting chardet==3.0.4 (from funkapi)
  Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting docutils==0.14 (from funkapi)
  Using cached docutils-0.14-py3-none-any.whl (543 kB)
Collecting ecdsa==0.13.2 (from funkapi)
  Using cached ecdsa-0.13.2-py2.py3-none-any.whl (59 kB)
Collecting envs==1.3 (from funkapi)
  Using cached envs-1.3-py2.py3-none-any.whl (29 kB)
Collecting future==0.17.1 (from funkapi)
  Using cached future-0.17.1-py3-none-any.whl
Collecting idna==2.8 (from funkapi)
  Using cached idna-2.8-py2.py3-none-any.whl (58 kB)
Collecting jmespath==0.9.4 (from funkapi)
  Using cached jmespath-0.9.4-py2.py3-none-any.whl (24 kB)
Collecting pycryptodome==3.3.1 (from funkapi)
  Using cached pycryptodome-3.3.1-cp311-cp311-linux_aarch64.whl
Collecting python-dateutil==2.8.0 (from funkapi)
  Using cached python_dateutil-2.8.0-py2.py3-none-any.whl (226 kB)
Collecting python-jose-cryptodome==1.3.2 (from funkapi)
  Using cached python_jose_cryptodome-1.3.2-py2.py3-none-any.whl (19 kB)
Collecting requests==2.21.0 (from funkapi)
  Using cached requests-2.21.0-py2.py3-none-any.whl (57 kB)
Collecting s3transfer==0.2.0 (from funkapi)
  Using cached s3transfer-0.2.0-py2.py3-none-any.whl (69 kB)
Collecting six==1.12.0 (from funkapi)
  Using cached six-1.12.0-py2.py3-none-any.whl (10 kB)
Collecting urllib3==1.24.3 (from funkapi)
  Using cached urllib3-1.24.3-py2.py3-none-any.whl (118 kB)
Collecting warrant==0.6.1 (from funkapi)
  Using cached warrant-0.6.1-py2.py3-none-any.whl (26 kB)
Installing collected packages: pycryptodome, jmespath, envs, ecdsa, docutils, chardet, certifi, urllib3, six, idna, future, requests, python-jose-cryptodome, python-dateutil, botocore, s3transfer, boto3, warrant, funkapi
Successfully installed boto3-1.9.145 botocore-1.12.145 certifi-2019.3.9 chardet-3.0.4 docutils-0.14 ecdsa-0.13.2 envs-1.3 funkapi-0.1.5 future-0.17.1 idna-2.8 jmespath-0.9.4 pycryptodome-3.3.1 python-dateutil-2.8.0 python-jose-cryptodome-1.3.2 requests-2.21.0 s3transfer-0.2.0 six-1.12.0 urllib3-1.24.3 warrant-0.6.1

When I simply import it, I get this error:

(funkapi) ~ $ python3
Python 3.11.2 (main, Feb 11 2023, 14:06:23) [Clang 14.0.7 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0 on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from funkapi import FunkAPI
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/data/com.termux/files/home/funkapi/lib/python3.11/site-packages/funkapi/__init__.py", line 1, in <module>
    from funkapi.api import FunkAPI
  File "/data/data/com.termux/files/home/funkapi/lib/python3.11/site-packages/funkapi/api.py", line 2, in <module>
    import boto3
  File "/data/data/com.termux/files/home/funkapi/lib/python3.11/site-packages/boto3/__init__.py", line 16, in <module>
    from boto3.session import Session
  File "/data/data/com.termux/files/home/funkapi/lib/python3.11/site-packages/boto3/session.py", line 17, in <module>
    import botocore.session
  File "/data/data/com.termux/files/home/funkapi/lib/python3.11/site-packages/botocore/session.py", line 29, in <module>
    import botocore.configloader
  File "/data/data/com.termux/files/home/funkapi/lib/python3.11/site-packages/botocore/configloader.py", line 19, in <module>
    from botocore.compat import six
  File "/data/data/com.termux/files/home/funkapi/lib/python3.11/site-packages/botocore/compat.py", line 25, in <module>
    from botocore.exceptions import MD5UnavailableError
  File "/data/data/com.termux/files/home/funkapi/lib/python3.11/site-packages/botocore/exceptions.py", line 15, in <module>
    from botocore.vendored import requests
  File "/data/data/com.termux/files/home/funkapi/lib/python3.11/site-packages/botocore/vendored/requests/__init__.py", line 58, in <module>
    from . import utils
  File "/data/data/com.termux/files/home/funkapi/lib/python3.11/site-packages/botocore/vendored/requests/utils.py", line 26, in <module>
    from .compat import parse_http_list as _parse_list_header
  File "/data/data/com.termux/files/home/funkapi/lib/python3.11/site-packages/botocore/vendored/requests/compat.py", line 7, in <module>
    from .packages import chardet
  File "/data/data/com.termux/files/home/funkapi/lib/python3.11/site-packages/botocore/vendored/requests/packages/__init__.py", line 3, in <module>
    from . import urllib3
  File "/data/data/com.termux/files/home/funkapi/lib/python3.11/site-packages/botocore/vendored/requests/packages/urllib3/__init__.py", line 10, in <module>
    from .connectionpool import (
  File "/data/data/com.termux/files/home/funkapi/lib/python3.11/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py", line 38, in <module>
    from .response import HTTPResponse
  File "/data/data/com.termux/files/home/funkapi/lib/python3.11/site-packages/botocore/vendored/requests/packages/urllib3/response.py", line 9, in <module>
    from ._collections import HTTPHeaderDict
  File "/data/data/com.termux/files/home/funkapi/lib/python3.11/site-packages/botocore/vendored/requests/packages/urllib3/_collections.py", line 1, in <module>
    from collections import Mapping, MutableMapping
ImportError: cannot import name 'Mapping' from 'collections' (/data/data/com.termux/files/usr/lib/python3.11/collections/__init__.py)

I've been running this in Termux on my Android device.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant