Tag: Python

  • A4988 Stepper motor RaspberryPi

    A4988 Stepper motor RaspberryPi

    We’re using a 42shd0034-20B Geetech stepping motor taken from a 3d printer: We’ll be driving it with an A4988 stepper motor controller. You can pick up five packs of these for less than $2 online – definitely worth having a few extras around: The datasheet is available here: https://www.pololu.com/file/download/A4988.pdf?file_id=0J450 The following diagram illustrates what we’ll…

  • 4: /codebuild/output/tmp/script.sh: pip: not found – Node.js and CodeStar

    Hi everyone, I ran into the following CodeBuild error after upgrading my build environment from the default nodejs8.10 to nodejs10.14: 4: /codebuild/output/tmp/script.sh: pip: not found This one was a little confusing, but thankfully fairly easy to fix. In your buildspec.yml file update the pip steps to reference pip3 instead of pip: // Original commands: #…

  • AWS IoT – error in discovery certificate_verify_failed

    Hi everyone, I ran into the following error while using the AWS IoT python SDK: Error in discovery! Type: Error message: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:720) It turns out that this was because I was using the wrong root certificate. In the documentation there are five certificates listed: RSA 2048 bit key: VeriSign Class…

  • AttributeError: module ‘serial’ has no attribute ‘SerialException’ – Python 3.5

    Hi everyone, A quick fix for an error I ran into while updating to Pyhton 3.5.2: AttributeError: module ‘serial’ has no attribute ‘SerialException’ I needed to add pyserial: pi@raspberrypi:~/Desktop/piscripts/get-commands $ sudo pip3.5 install pyserial Collecting pyserial Downloading pyserial-3.4-py2.py3-none-any.whl (193kB) 100% |████████████████████████████████| 194kB 530kB/s Installing collected packages: pyserial Successfully installed pyserial-3.4 Thanks to the following link:…

  • Could not find a version that satisfied the requirement smbus/python3-smbus

    Hi everyone, I ran into a bit of an issue installing smbus on Python3.5. It looks like all you have to do is use smbus2: pip3.5 install smbus2 Collecting smbus2 Downloading smbus2-0.2.0.tar.gz Building wheels for collected packages: smbus2 Running setup.py bdist_wheel for smbus2 … done Stored in directory: /root/.cache/pip/wheels/90/71/b4/9f90d8e2d0349ab55fef07169a81bd8f925965f16174e2f809 Successfully built smbus2 Installing collected packages:…

  • Pillow Install Fails – Python 3.5.2

    Hi everyone, I ran into a bit of an issue trying to install Pillow on Raspbian with Python 3.5.2. The full error is below, but the solution was simply to install the following: sudo apt-get install libjpeg8-dev sudo pip3.5 install pillow sudo pip3.5 install pillow Collecting pillow Using cached Pillow-4.3.0.tar.gz Requirement already satisfied: olefile in…

  • Updating to Python 3.5.1 on RaspberryPi

    Hi everyone, Just a quick post on how to update to Python 3.5.1 the normal upgrade process isn’t working for you: cd ~ wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz tar -zxvf Python-3.5.1.tgz cd Python-3.5.1 ./configure && make && sudo make install You may need to restart once this is complete. Run the following to confirm that the version is…

  • Check Tensorflow Version – Raspbian

    Hey everyone, Just a quick post on how to check the Tensorflow version on Raspbian with a one-liner (assumes Python 3.x): python3 -c ‘import tensorflow as tf; print(tf.__version__)’ Check out this Stackoverflow post for more info: https://stackoverflow.com/a/38549357/522859

  • AttributeError: ‘dict’ object has no attribute ‘iteritems’ – Python

    Hey everyone, Just running through object detection samples for Tensorflow and I encountered the following error: Sample: https://github.com/GoogleCloudPlatform/tensorflow-object-detection-example AttributeError: ‘dict’ object has no attribute ‘iteritems’ The issue seems to be that the sample hasn’t been made compatible with Python 3.x. Simply make the following change and it should work: # Original for cls, new_image in…

  • Converting proto files to .py on Windows – Tensorflow

    Hey everyone, Ran into a bit of an issue today with Tensorflow: ImportError: cannot import name preprocessor_pb2 Turned out that I hadn’t run some of the installing steps. I needed to use protoc to convert the proto directory files: protoc object_detection/protos/preprocessor_pb2.proto –python_out=. This turned out to be a bit of a headache as well, but…

Create a website or blog at WordPress.com