Moto: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses

Created on 23 Jul 2020  路  1Comment  路  Source: spulec/moto

I'm getting this deprecation warning that seems un-reported.

python 3.8

environment:

鈺扳攢 pipenv graph | grep oto
moto==1.3.14
    - botocore [required: >=1.11.3, installed: 1.17.26]
  - boto [required: >=2.36.0, installed: 2.49.0]
  - boto3 [required: >=1.9.201, installed: 1.14.26]
    - botocore [required: >=1.17.26,<1.18.0, installed: 1.17.26]
      - botocore [required: >=1.12.36,<2.0a.0, installed: 1.17.26]
  - botocore [required: >=1.12.201, installed: 1.17.26]
      - boto3 [required: ~=1.5, installed: 1.14.26]
        - botocore [required: >=1.17.26,<1.18.0, installed: 1.17.26]
          - botocore [required: >=1.12.36,<2.0a.0, installed: 1.17.26]

I got it while using mock_ssm, not sure if that's relevant.

dependency-management

Most helpful comment

I think that warning is coming from boto.plugin -- you get it as soon as you import moto because it imports boto. It doesn't look like boto is ever going to fix that so if this is the right diagnosis the only fix for moto is to stop using boto.

$ python -Wd
Python 3.7.8 | packaged by conda-forge | (default, Jul 23 2020, 03:39:37) 
[Clang 10.0.0 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import moto
.../lib/python3.7/site-packages/boto/plugin.py:40: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp

>All comments

I think that warning is coming from boto.plugin -- you get it as soon as you import moto because it imports boto. It doesn't look like boto is ever going to fix that so if this is the right diagnosis the only fix for moto is to stop using boto.

$ python -Wd
Python 3.7.8 | packaged by conda-forge | (default, Jul 23 2020, 03:39:37) 
[Clang 10.0.0 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import moto
.../lib/python3.7/site-packages/boto/plugin.py:40: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
Was this page helpful?
0 / 5 - 0 ratings