

以下の極めてシンプルなコードを実行したところ，

[code]

     from boxsdk import JWTAuth
    
[/code]

urllib3関連の以下のエラーが出てしまいました。

[code]

    Traceback (most recent call last):
      File "C:\user\requests_toolbelt\_compat.py", line 48, in <module>
        from requests.packages.urllib3.contrib import appengine as gaecontrib
    ImportError: cannot import name 'appengine' from 'requests.packages.urllib3.contrib' (C:\user\urllib3\contrib\__init__.py)
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "C:\user\boxsdk\__init__.py", line 1, in <module>
        from .auth import JWTAuth, OAuth2, CCGAuth
      File "C:\user\boxsdk\auth\__init__.py", line 1, in <module>
        from .cooperatively_managed_oauth2 import CooperativelyManagedOAuth2
      File "C:\user\boxsdk\auth\cooperatively_managed_oauth2.py", line 3, in <module>
        from .oauth2 import OAuth2
      File "C:\user\boxsdk\auth\oauth2.py", line 12, in <module>
        from ..session.session import Session
      File "C:\user\boxsdk\session\session.py", line 17, in <module>
        from ..util.multipart_stream import MultipartStream
      File "C:\user\boxsdk\util\multipart_stream.py", line 3, in <module>
        from requests_toolbelt.multipart.encoder import MultipartEncoder
      File "C:\user\requests_toolbelt\__init__.py", line 12, in <module>
        from .adapters import SSLAdapter, SourceAddressAdapter
      File "C:\user\requests_toolbelt\adapters\__init__.py", line 12, in <module>
        from .ssl import SSLAdapter
      File "C:\user\requests_toolbelt\adapters\ssl.py", line 16, in <module>
        from .._compat import poolmanager
      File "C:\user\requests_toolbelt\_compat.py", line 50, in <module>
        from urllib3.contrib import appengine as gaecontrib
    ImportError: cannot import name 'appengine' from 'urllib3.contrib' (C:\user\urllib3\contrib\__init__.py)
    
[/code]

同様の案件が近日中に複数報告されており，試せそうな策は試したのですが解決に至らず，打つ手がない状態です。  
ご知見をお持ちの方がいらしたらご助力を願えないでしょうか。どうぞよろしくお願いいたします。

**参考URL**  
<https://stackoverflow.com/questions/76175487/sudden-importerror-cannot-
import-name-appengine-from-requests-packages-urlli>  
<https://github.com/apache/arrow/issues/35410>  
<https://community.jeedom.com/t/cannot-import-name-appengine-from-
urllib3-contrib/106921>

**`pip freeze` の結果** (Python 3.11)

[code]

    appengine-python-standard==1.1.1
    attrs==23.1.0
    boxsdk==3.7.1
    cachetools==5.3.0
    certifi==2023.5.7
    cffi==1.15.1
    charset-normalizer==3.1.0
    cryptography==40.0.2
    frozendict==2.3.8
    google-auth==2.18.1
    idna==3.4
    mock==5.0.2
    Pillow==9.5.0
    protobuf==4.23.1
    pyasn1==0.5.0
    pyasn1-modules==0.3.0
    pycparser==2.21
    PyJWT==2.7.0
    python-dateutil==2.8.2
    pytz==2023.3
    requests==2.31.0
    requests-toolbelt==0.10.1
    rsa==4.9
    ruamel.yaml==0.17.26
    ruamel.yaml.clib==0.2.7
    six==1.16.0
    urllib3==1.26.15
    
[/code]


CC BY-SA 4.0
2023-05-25T05:53:11.487
94971
2023-05-25T07:01:21.210
2023-05-25T07:01:21.210
3060
58446
question
python pip
boxsdkのJWTAuthをインポートしようとするとcannot import name 'appengine' from 'urllib3.contrib'のエラーが出る