question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sense Hat can't find RTIMU after upgrade to Python 3.5.2

See original GitHub issue

I recently upgraded the GNU R packages from 3.1.1 to 3.3.1. To do this, I had to add the stretch distribution to my /etc/apt/sources.list file. In the process of successfully upgrading GNU R, apt also chose to install an upgraded version of Python3. Now when I try to use the Sense Hat module with Python3, I get the following error message:

`Python 3.5.2+ (default, Sep 22 2016, 12:18:14) [GCC 6.1.1 20160802] on linux Type “copyright”, “credits” or “license()” for more information.

from sense_hat import SenseHat Traceback (most recent call last): File “<pyshell#0>”, line 1, in <module> from sense_hat import SenseHat File “/usr/lib/python3/dist-packages/sense_hat/init.py”, line 2, in <module> from .sense_hat import SenseHat, SenseHat as AstroPi File “/usr/lib/python3/dist-packages/sense_hat/sense_hat.py”, line 10, in <module> import RTIMU # custom version ImportError: No module named ‘RTIMU’ `

pip3 reports that sense-hat 2.2.0 and RTIMUlib 7.2.1 are installed. I do NOT get this error when I use Python 2.7.9.

Any ideas on what got broken during the apt-get install of r-base? It was working fine before the GNU R upgrade.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
eplanetcommented, Mar 23, 2018

That’s very nice of you! I just tested successfully with:

sudo apt install libopenjp2-7 sense-hat
pip install sense-hat rtimulib

That seem to be sufficient, libtiff-tools is installed as a sense-hat dependency and I didn’t need libatlas-base-dev at all. Hope this helps!

6reactions
eplanetcommented, Mar 19, 2018

As it’s not very clear in that thread, I’d like to share what I did. Basically following bennuttall recommendation did the trick:

  • Create a virtualenv:
    • virtualenv -p /usr/bin/python3 ~/.ve/sensorhat
    • source ~/.ve/sensorhat/bin/activate
  • Clone RTIMULib:
    • git clone https://github.com/RPi-Distro/RTIMULib/ RTIMU
    • cd RTIMU/Linux/python
  • Follow instruction in RTIMULib/Linux/python:
    • sudo apt install python3-dev
    • python setup.py build
    • python setup.py install
  • Install libopenjp2-7:
    • sudo apt install libopenjp2-7
  • Install sense-hat:
    • sudo apt install sense-hat

That should do the trick. Some code like this should work:

from sense_hat import SenseHat

sense = SenseHat()
print('temperature', float(sense.get_temperature()))
print('humidity', float(sense.get_humidity()))
print('pressure', float(sense.get_pressure()))
Read more comments on GitHub >

github_iconTop Results From Across the Web

Sense Hat missing RTIMU module - Raspberry Pi Forums
It was working before the GNU R upgrade and Python2 still works with the Sense Hat after the upgrade. So I suspect it's...
Read more >
Sense Hat missing RTIMU module - Raspberry Pi ... - Abdullai
need sense hat module work again under python3? working before gnu r upgrade , python2 still works sense hat after upgrade. suspect it's ......
Read more >
sense-hat - PyPI
Python module to control the Raspberry Pi Sense HAT used in the Astro Pi mission - an education outreach programme for UK schools...
Read more >
python - Anthony Fourie
Time to write the code that will log records to our database. The idea is simple. Run a loop. Every few seconds get...
Read more >
Raspberry Pi Sense HAT Board - Operating LEDs - DevicePlus
In the first article in this series, we'll play with the LED display on the Sense HAT while studying the use of “IDLE”...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found