Skip to content

Conversation

@sparkgene
Copy link
Contributor

Issue #, if available:

Raspberry Pi occurs an error at installing awsiotsdk

Description of changes:

This changes show the step to install AWS IoT Device SDK Python on Raspberry Pi (buster)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@bretambrose bretambrose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for posting this. We were fairly certain we had decent Python support on Raspberry Pi via piwheels.org and that normally you should only need to do the last step. We checked the most recent build report and saw that the build failed for 3.4. Are you using 3.4?

These steps seem correct as a fallback, but ideally if just pip-installing the SDK is not working then there's a problem that we should address.

Edit: I've been informed that 3.4 no longer has LTS and supporting it is unlikely.

@sparkgene
Copy link
Contributor Author

I tried to use with Python 2.7. When I use Python3.7 install works good.

Here is my Raspberry Pi 4 details.

pi@raspberrypi:~ $ uname -a Linux raspberrypi 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux pi@raspberrypi:~ $ python -V Python 2.7.16 pi@raspberrypi:~ $ pip -V pip 18.1 from /usr/lib/python2.7/dist-packages/pip (python 2.7) 

install error at Python2.7

pi@raspberrypi:~ $ pip install awsiotsdk Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting awsiotsdk Using cached https://files.pythonhosted.org/packages/f9/c2/860d79771f1a576c8bfb5b2321a12bdc6396c8eafea5388977df2e942fe0/awsiotsdk-1.0.6-py2.py3-none-any.whl Collecting awscrt==0.5.13 (from awsiotsdk) Downloading https://files.pythonhosted.org/packages/a0/83/842c115218855899cecb4282c2b0a29d06ef592b37ac5d4996cfffa443c5/awscrt-0.5.13.tar.gz (1.9MB) 100% |################################| 1.9MB 201kB/s Collecting futures; python_version < "3.2" (from awsiotsdk) Downloading https://files.pythonhosted.org/packages/d8/a6/f46ae3f1da0cd4361c344888f59ec2f5785e69c872e175a748ef6071cdb5/futures-3.3.0-py2-none-any.whl Collecting typing; python_version < "3.5" (from awsiotsdk) Downloading https://files.pythonhosted.org/packages/22/30/64ca29543375759dc589ade14a6cd36382abf2bec17d67de8481bc9814d7/typing-3.7.4.1-py2-none-any.whl Requirement already satisfied: enum34 in /usr/lib/python2.7/dist-packages (from awscrt==0.5.13->awsiotsdk) (1.1.6) Building wheels for collected packages: awscrt Running setup.py bdist_wheel for awscrt ... error Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-Y7VBGT/awscrt/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-1G_z_K --python-tag cp27: running bdist_wheel running build running build_py creating build creating build/lib.linux-armv7l-2.7 creating build/lib.linux-armv7l-2.7/awscrt copying awscrt/http.py -> build/lib.linux-armv7l-2.7/awscrt copying awscrt/io.py -> build/lib.linux-armv7l-2.7/awscrt copying awscrt/exceptions.py -> build/lib.linux-armv7l-2.7/awscrt copying awscrt/auth.py -> build/lib.linux-armv7l-2.7/awscrt copying awscrt/mqtt.py -> build/lib.linux-armv7l-2.7/awscrt copying awscrt/crypto.py -> build/lib.linux-armv7l-2.7/awscrt copying awscrt/__init__.py -> build/lib.linux-armv7l-2.7/awscrt copying awscrt/awsiot_mqtt_connection_builder.py -> build/lib.linux-armv7l-2.7/awscrt running build_ext Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-Y7VBGT/awscrt/setup.py", line 267, in <module> 'boto3' File "/usr/lib/python2.7/dist-packages/setuptools/__init__.py", line 145, in setup return distutils.core.setup(**attrs) File "/usr/lib/python2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/dist-packages/wheel/bdist_wheel.py", line 188, in run self.run_command('build') File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run self.run_command(cmd_name) File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/tmp/pip-install-Y7VBGT/awscrt/setup.py", line 180, in run self._build_dependency(lib) File "/tmp/pip-install-Y7VBGT/awscrt/setup.py", line 126, in _build_dependency check_cmake_installed() File "/tmp/pip-install-Y7VBGT/awscrt/setup.py", line 96, in check_cmake_installed raise Exception("'cmake' not found. cmake must be installed to build from source.") Exception: 'cmake' not found. cmake must be installed to build from source. ---------------------------------------- Failed building wheel for awscrt Running setup.py clean for awscrt Failed to build awscrt Installing collected packages: futures, awscrt, typing, awsiotsdk Running setup.py install for awscrt ... error Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-Y7VBGT/awscrt/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-4uBJAl/install-record.txt --single-version-externally-managed --compile --user --prefix=: running install running build running build_py creating build creating build/lib.linux-armv7l-2.7 creating build/lib.linux-armv7l-2.7/awscrt copying awscrt/http.py -> build/lib.linux-armv7l-2.7/awscrt copying awscrt/io.py -> build/lib.linux-armv7l-2.7/awscrt copying awscrt/exceptions.py -> build/lib.linux-armv7l-2.7/awscrt copying awscrt/auth.py -> build/lib.linux-armv7l-2.7/awscrt copying awscrt/mqtt.py -> build/lib.linux-armv7l-2.7/awscrt copying awscrt/crypto.py -> build/lib.linux-armv7l-2.7/awscrt copying awscrt/__init__.py -> build/lib.linux-armv7l-2.7/awscrt copying awscrt/awsiot_mqtt_connection_builder.py -> build/lib.linux-armv7l-2.7/awscrt running build_ext Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-Y7VBGT/awscrt/setup.py", line 267, in <module> 'boto3' File "/usr/lib/python2.7/dist-packages/setuptools/__init__.py", line 145, in setup return distutils.core.setup(**attrs) File "/usr/lib/python2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/dist-packages/setuptools/command/install.py", line 61, in run return orig.install.run(self) File "/usr/lib/python2.7/distutils/command/install.py", line 601, in run self.run_command('build') File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run self.run_command(cmd_name) File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/tmp/pip-install-Y7VBGT/awscrt/setup.py", line 180, in run self._build_dependency(lib) File "/tmp/pip-install-Y7VBGT/awscrt/setup.py", line 126, in _build_dependency check_cmake_installed() File "/tmp/pip-install-Y7VBGT/awscrt/setup.py", line 96, in check_cmake_installed raise Exception("'cmake' not found. cmake must be installed to build from source.") Exception: 'cmake' not found. cmake must be installed to build from source. ---------------------------------------- Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-Y7VBGT/awscrt/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-4uBJAl/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-Y7VBGT/awscrt/ 
@graebm
Copy link
Contributor

graebm commented Apr 21, 2020

aha, piwheels.org does not supply python 2.7 wheels:

Wheels are provided for Raspbian Jessie (Python 3.4), Raspbian Stretch (Python 3.5) and Raspbian Buster (Python 3.7)

that explains why it's necessary to compile for 2.7 but not 3.7.

Copy link
Contributor

@graebm graebm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@graebm graebm merged commit 9a4873a into aws:master Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants