User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1662
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

New release of Sense HAT Python library v2.2.0

Wed Jul 13, 2016 9:43 am

Hi all

We have just done a new release of the Sense HAT python library. Version 2.2.0.
It's planned to go ino the next Raspbian image however, if you want it now, you can install it using pip.

Code: Select all

sudo apt-get remove python-sense-hat python3-sense-hat
sudo pip install sense_hat
sudo pip3 install sense_hat
The main change of note is new the joystick functionality. Previously you would've had to use libraries like pygame and evedev to capture input events, now the Sense HAT library supports the joystick directly with no other dependencies.

Examples here

Please feel free to give it a test and if you find any issues please report them here.
Many thanks

Dave

User avatar
bensimmo
Posts: 4128
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: New release of Sense HAT Python library v2.2.0

Wed Jul 27, 2016 10:10 am

Thanks :-)

Makes it a lot easier from my point of view.

Changlog needs a version bump while I'm here
https://github.com/RPi-Distro/python-se ... angelog.md

alphanumeric
Posts: 1920
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: New release of Sense HAT Python library v2.2.0

Fri Aug 12, 2016 9:58 pm

Nice, I guess, lol. I wanted this way back when I first got my sense hat, it means redoing my code though. I'm currently using evedev. Don't get me wrong, thank you. :D Good things come to those that wait.

User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1662
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

Re: New release of Sense HAT Python library v2.2.0

Tue Aug 23, 2016 8:32 am

Just to let you know the latest version of the API is now in apt. To pull it run the following commands.

Code: Select all

sudo apt-get update
sudo apt-get install python-sense-hat python3-sense-hat -y

mastermirko
Posts: 2
Joined: Sun Dec 04, 2016 4:25 pm

Re: New release of Sense HAT Python library v2.2.0

Sun Dec 04, 2016 5:01 pm

Hello!
I'm on ubuntu 16.04 on my raspberry pi3, and I did

Code: Select all

sudo apt-get install python-sense-hat python3-sense-hat
and the library was installed fine, with version 2.1, which does not have the new stick interface.
I then tried

Code: Select all

sudo apt-get remove python-sense-hat python3-sense-hat
sudo -H pip install sense_hat
sudo -H pip3 install sense_hat
and it installed the library fine, but the sense hat library could not be imported anymore by python.

I then tried again

Code: Select all

sudo apt-get install python-sense-hat python3-sense-hat
but it was still not possible to import the library in python.

I then tried

Code: Select all

sudo apt-get install sense-hat
from https://pypi.python.org/pypi/sense-hat and it installed fine the library and it is possible to import it, but still no stick interface.

I configured this system brand new last week, so maybe the apt source I'm using does not have the right version of the sensehat library.

How can I handle this?

Thanks!
Mirko

User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1662
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

Re: New release of Sense HAT Python library v2.2.0

Fri Dec 16, 2016 9:58 am

You could try a manual install? I would remove everything first and then start again;

Code: Select all

git clone https://github.com/RPi-Distro/python-sense-hat
cd python-sense-hat
sudo python setup.py install
sudo python3 setup.py install

mastermirko
Posts: 2
Joined: Sun Dec 04, 2016 4:25 pm

Re: New release of Sense HAT Python library v2.2.0

Wed Dec 21, 2016 10:24 pm

Davespice wrote:You could try a manual install? I would remove everything first and then start again;
Thanks! That worked! Strange that the repos are hold though!

Dedward5
Posts: 14
Joined: Fri Jan 13, 2017 11:18 am

Re: New release of Sense HAT Python library v2.2.0

Fri Jan 13, 2017 11:28 am

Hi,

Im really struggling with this (joystick) this tread looks promising but when I try to do the manual install I get the message

ImportError: No module named setuptools

Ps im doing the manual install because the usual install method does not seem to give me the sense stick module.

Thanks,

User avatar
DougieLawson
Posts: 35577
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: New release of Sense HAT Python library v2.2.0

Fri Jan 13, 2017 12:37 pm

sudo apt-get install python{,3}-setuptools
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Astro Pi”