vemel/mypy_boto3

Install of boto3-stubs[ec2,route53] fails

Closed this issue · 3 comments

I just created a fresh virtual environment with Python 3.7.3 and when I do venv_mypy/bin/pip install "boto3-stubs[ec2,route53]" I get:

Collecting boto3-stubs[ec2,route53]
  Downloading https://files.pythonhosted.org/packages/6e/b2/b6ce7a700156cae9d91899a1f32b3115d7ae0d335f616ed0b9fe1f30c682/boto3-stubs-1.10.38.1.tar.gz
Collecting typing_extensions (from boto3-stubs[ec2,route53])
  Using cached https://files.pythonhosted.org/packages/03/92/705fe8aca27678e01bbdd7738173b8e7df0088a2202c80352f664630d638/typing_extensions-3.7.4.1-py3-none-any.whl
Collecting mypy-boto3-ec2[master]==1.10.38.1 (from boto3-stubs[ec2,route53])
  Downloading https://files.pythonhosted.org/packages/d8/2e/2a983f847e5bd8a7446c34cc9a4d10bd356d4e6146c62826e366cf947488/mypy-boto3-ec2-1.10.38.1.tar.gz (83kB)
    100% |████████████████████████████████| 92kB 8.1MB/s 
Collecting mypy-boto3-route53[master]==1.10.38.1 (from boto3-stubs[ec2,route53])
  Downloading https://files.pythonhosted.org/packages/14/e0/ca2207cb8541b57c2c3dff85cce1f607720b6b93fc0f08ac786cb68dc529/mypy-boto3-route53-1.10.38.1.tar.gz
Collecting mypy-boto3==1.10.38.1 (from mypy-boto3-ec2[master]==1.10.38.1->boto3-stubs[ec2,route53])
  Downloading https://files.pythonhosted.org/packages/98/39/716cc67f447b52a215c572de9631c64d8962ec7ae2c209b49d61d2b7f16d/mypy-boto3-1.10.38.1.tar.gz
Collecting boto3 (from mypy-boto3==1.10.38.1->mypy-boto3-ec2[master]==1.10.38.1->boto3-stubs[ec2,route53])
  Downloading https://files.pythonhosted.org/packages/2e/b4/e8fb59efd68d4889528cb0d4227484b5aa511b765d81e05d2cd7d9bb3ca5/boto3-1.10.38-py2.py3-none-any.whl (128kB)
    100% |████████████████████████████████| 133kB 8.1MB/s 
Collecting botocore<1.14.0,>=1.13.38 (from boto3->mypy-boto3==1.10.38.1->mypy-boto3-ec2[master]==1.10.38.1->boto3-stubs[ec2,route53])
  Downloading https://files.pythonhosted.org/packages/89/7b/91602326d58e4a59a0e510e88858b4c072110679044053148545b5a170fb/botocore-1.13.38-py2.py3-none-any.whl (5.8MB)
    100% |████████████████████████████████| 5.8MB 7.7MB/s 
Collecting s3transfer<0.3.0,>=0.2.0 (from boto3->mypy-boto3==1.10.38.1->mypy-boto3-ec2[master]==1.10.38.1->boto3-stubs[ec2,route53])
  Using cached https://files.pythonhosted.org/packages/16/8a/1fc3dba0c4923c2a76e1ff0d52b305c44606da63f718d14d3231e21c51b0/s3transfer-0.2.1-py2.py3-none-any.whl
Collecting jmespath<1.0.0,>=0.7.1 (from boto3->mypy-boto3==1.10.38.1->mypy-boto3-ec2[master]==1.10.38.1->boto3-stubs[ec2,route53])
  Using cached https://files.pythonhosted.org/packages/83/94/7179c3832a6d45b266ddb2aac329e101367fbdb11f425f13771d27f225bb/jmespath-0.9.4-py2.py3-none-any.whl
Collecting docutils<0.16,>=0.10 (from botocore<1.14.0,>=1.13.38->boto3->mypy-boto3==1.10.38.1->mypy-boto3-ec2[master]==1.10.38.1->boto3-stubs[ec2,route53])
  Using cached https://files.pythonhosted.org/packages/22/cd/a6aa959dca619918ccb55023b4cb151949c64d4d5d55b3f4ffd7eee0c6e8/docutils-0.15.2-py3-none-any.whl
Collecting urllib3<1.26,>=1.20; python_version >= "3.4" (from botocore<1.14.0,>=1.13.38->boto3->mypy-boto3==1.10.38.1->mypy-boto3-ec2[master]==1.10.38.1->boto3-stubs[ec2,route53])
  Using cached https://files.pythonhosted.org/packages/b4/40/a9837291310ee1ccc242ceb6ebfd9eb21539649f193a7c8c86ba15b98539/urllib3-1.25.7-py2.py3-none-any.whl
Collecting python-dateutil<2.8.1,>=2.1; python_version >= "2.7" (from botocore<1.14.0,>=1.13.38->boto3->mypy-boto3==1.10.38.1->mypy-boto3-ec2[master]==1.10.38.1->boto3-stubs[ec2,route53])
  Using cached https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl
Collecting six>=1.5 (from python-dateutil<2.8.1,>=2.1; python_version >= "2.7"->botocore<1.14.0,>=1.13.38->boto3->mypy-boto3==1.10.38.1->mypy-boto3-ec2[master]==1.10.38.1->boto3-stubs[ec2,route53])
  Using cached https://files.pythonhosted.org/packages/65/26/32b8464df2a97e6dd1b656ed26b2c194606c16fe163c695a992b36c11cdf/six-1.13.0-py2.py3-none-any.whl
Installing collected packages: typing-extensions, docutils, jmespath, urllib3, six, python-dateutil, botocore, s3transfer, boto3, mypy-boto3, mypy-boto3-ec2, mypy-boto3-route53, boto3-stubs
  Running setup.py install for mypy-boto3 ... done
  Running setup.py install for mypy-boto3-ec2 ... error
    Complete output from command /home/matt/tmp/venv_mypy/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-z6k64ie0/mypy-boto3-ec2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-4jw5pfa2/install-record.txt --single-version-externally-managed --compile --install-headers /home/matt/tmp/venv_mypy/include/site/python3.7/mypy-boto3-ec2:
    running install
    running build
    running build_py
    creating build
    creating build/lib
    creating build/lib/mypy_boto3_ec2
    copying mypy_boto3_ec2/__init__.py -> build/lib/mypy_boto3_ec2
    copying mypy_boto3_ec2/__main__.py -> build/lib/mypy_boto3_ec2
    copying mypy_boto3_ec2/client.py -> build/lib/mypy_boto3_ec2
    copying mypy_boto3_ec2/paginator.py -> build/lib/mypy_boto3_ec2
    copying mypy_boto3_ec2/service_resource.py -> build/lib/mypy_boto3_ec2
    copying mypy_boto3_ec2/type_defs.py -> build/lib/mypy_boto3_ec2
    copying mypy_boto3_ec2/version.py -> build/lib/mypy_boto3_ec2
    copying mypy_boto3_ec2/waiter.py -> build/lib/mypy_boto3_ec2
    copying mypy_boto3_ec2/py.typed -> build/lib/mypy_boto3_ec2
    running install_lib
    creating /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2
    copying build/lib/mypy_boto3_ec2/__init__.py -> /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2
    copying build/lib/mypy_boto3_ec2/__main__.py -> /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2
    copying build/lib/mypy_boto3_ec2/client.py -> /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2
    copying build/lib/mypy_boto3_ec2/paginator.py -> /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2
    copying build/lib/mypy_boto3_ec2/service_resource.py -> /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2
    copying build/lib/mypy_boto3_ec2/type_defs.py -> /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2
    copying build/lib/mypy_boto3_ec2/version.py -> /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2
    copying build/lib/mypy_boto3_ec2/waiter.py -> /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2
    copying build/lib/mypy_boto3_ec2/py.typed -> /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2
    byte-compiling /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2/__init__.py to __init__.cpython-37.pyc
    byte-compiling /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2/__main__.py to __main__.cpython-37.pyc
    byte-compiling /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2/client.py to client.cpython-37.pyc
    byte-compiling /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2/paginator.py to paginator.cpython-37.pyc
    byte-compiling /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2/service_resource.py to service_resource.cpython-37.pyc
    byte-compiling /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2/type_defs.py to type_defs.cpython-37.pyc
    byte-compiling /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2/version.py to version.cpython-37.pyc
    byte-compiling /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2/waiter.py to waiter.cpython-37.pyc
    running install_egg_info
    running egg_info
    writing mypy_boto3_ec2.egg-info/PKG-INFO
    writing dependency_links to mypy_boto3_ec2.egg-info/dependency_links.txt
    writing requirements to mypy_boto3_ec2.egg-info/requires.txt
    writing top-level names to mypy_boto3_ec2.egg-info/top_level.txt
    reading manifest file 'mypy_boto3_ec2.egg-info/SOURCES.txt'
    writing manifest file 'mypy_boto3_ec2.egg-info/SOURCES.txt'
    Copying mypy_boto3_ec2.egg-info to /home/matt/tmp/venv_mypy/lib/python3.7/site-packages/mypy_boto3_ec2-1.10.38.1-py3.7.egg-info
    running install_scripts
    writing list of installed files to '/tmp/pip-record-4jw5pfa2/install-record.txt'
    
    ----------------------------------------
Command "/home/matt/tmp/venv_mypy/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-z6k64ie0/mypy-boto3-ec2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-4jw5pfa2/install-record.txt --single-version-externally-managed --compile --install-headers /home/matt/tmp/venv_mypy/include/site/python3.7/mypy-boto3-ec2" failed with error code 1 in /tmp/pip-install-z6k64ie0/mypy-boto3-ec2/

However, I can do an install of boto3-stubs[route53] followed by boto3-stubs[ec2] and it works fine.

vemel commented

There was an error on initial install in the previous version, because mypy-boto3 was installed after services. It was fixed in latest version.

Second installation, once mypy-boto3 is already installed works as it should. Just update to the latest version. The reason why it failed - I experimented with post-install script that builds index for you, so you do not need to run python -m mypy-boto3. Latest version does everything correctly, so I am going to update readme soon.

vemel commented

If you want to help me with testing, do

python -m pip uninstall boto3-stubs mypy-boto3 mypy-boto3-route53 mypy-boto3-ec2

python -m pip install boto3-stubs[ec2,route53]

Let me know if it works for you with no errors.

That now installs correctly with no errors. Thank you very much!