Go to advanced search

by ben_nuttall
Thu Sep 05, 2019 10:34 pm
Forum: Python
Topic: guizero - question, in more ways than one
Replies: 4
Views: 148

Re: guizero - question, in more ways than one

Find what version you have:
pip3 freeze | grep guizero
(it takes a while)

Alternatively, use this method: https://gpiozero.readthedocs.io/en/stab ... -installed

To upgrade:
pip3 install guizero --upgrade
by ben_nuttall
Thu Aug 29, 2019 9:36 pm
Forum: Python
Topic: STICKY: [announcement] python 2 end of life
Replies: 14
Views: 1137

Re: python 2 end of life

Thanks plugwash People talking about moving Python 3 to /usr/bin/python please read PEP-394 https://www.python.org/dev/peps/pep-0394/ piwheels.org has never supported Python 2 - so installing packages with pip is lightning fast for Python 3 users only. Maybe what's needed is an LXTermial hack (that ...
by ben_nuttall
Thu Jul 18, 2019 9:43 pm
Forum: Python
Topic: piwheels update: Python 3.7 wheels for Raspbian Buster now available
Replies: 0
Views: 194

piwheels update: Python 3.7 wheels for Raspbian Buster now available

Raspbian Buster builds are now complete: https://blog.piwheels.org/raspbian-buster-builds-complete/ If you find any missing packages, or have any issues with packages from piwheels, please open an issue here: https://github.com/piwheels/packages/issues More more info on the piwheels project, see www...
by ben_nuttall
Thu Jul 18, 2019 9:40 pm
Forum: Python
Topic: gpiozero SPI select CS1 issue
Replies: 3
Views: 273

Re: gpiozero SPI select CS1 issue

You don't need to import spidev. Use the keyword arguments in gpiozero's MCP3002 class documented here: https://gpiozero.readthedocs.io/en/stab ... yword-args
by ben_nuttall
Mon Jun 24, 2019 4:52 pm
Forum: Python
Topic: sudo pip3 install opencv-python fails...
Replies: 6
Views: 996

Re: sudo pip3 install opencv-python fails...

opencv don't release soirce distribution to PyPI, so there's nothing to build. The only reason it's been available recently is that the piwheels project builds it from github and releases it. We haven't built opencv for Buster yet. You'll have to be patient. Ref: https://pypi.org/project/opencv-pyth...
by ben_nuttall
Mon Jun 10, 2019 5:30 pm
Forum: Python
Topic: Moving 16 servos in a wave
Replies: 11
Views: 580

Re: Moving 16 servos in a wave

Does the servo hat allow you to use GPIO Zero, or does it have another interface than just PWM on GPIO pins? Would be really easy with GPIO Zero: from gpiozero import Servo from gpiozero.tools import cos_values from signal import pause servos = [Servo(pin) for pin in (2, 3, 4, 5, 6, 7)] for servo in...
by ben_nuttall
Sun Jun 09, 2019 1:19 am
Forum: Python
Topic: Emergency Action Required by RPi Foundation
Replies: 31
Views: 1867

Re: Emergency Action Required by RPi Foundation

bensimmo wrote:
Sat Jun 08, 2019 5:08 pm
Ben, how's piwheels doing for 3.6/3.7 whichever ends up in Buster? (3.7 if it follows my RPDx86 "buster" test).
Is it all setup and ready?
I remember reading you were getting it ready, but haven't check to see how far you got.
Working on it! Will just be 3.7, not 3.6.
by ben_nuttall
Sat Jun 08, 2019 2:01 pm
Forum: Python
Topic: Python library not found: libpython3.7.so.1.0, libpython3.7m.so.1.0, libpython3.7mu.so.1.0
Replies: 4
Views: 1062

Re: Python library not found: libpython3.7.so.1.0, libpython3.7m.so.1.0, libpython3.7mu.so.1.0

Looks like you've installed Python 3.7 on Raspbian Stretch. You can't install an out-of-distribution Python version and expect system Python packages (like python3-dev) to work. They're compiled for Python 3.5 that's included in the distribution (Stretch). I suggest you upgrade to Buster (unreleased...
by ben_nuttall
Sat Jun 08, 2019 1:47 pm
Forum: Python
Topic: Emergency Action Required by RPi Foundation
Replies: 31
Views: 1867

Re: Emergency Action Required by RPi Foundation

https://www.python.org/dev/peps/pep-0394/ This PEP states that `python` should not point to Python 3. Raspbian follows Debian. Debian decide what's in each release, what's supported and what's not. Debian Buster is due out soon, and they decided to keep Python 2.7 in the repo. That means they'll sup...
by ben_nuttall
Thu May 23, 2019 10:46 pm
Forum: Python
Topic: RPi CPU temp with Python
Replies: 15
Views: 17651

Re: RPi CPU temp with Python

Code: Select all

from gpiozero import CPUTemperature

cpu = CPUTemperature()

print(cpu.temperature)
https://gpiozero.readthedocs.io/en/stab ... emperature
by ben_nuttall
Tue Apr 23, 2019 2:57 pm
Forum: Python
Topic: Use RPi.GPIO Library on Eclipse (mac)
Replies: 2
Views: 233

Re: Use RPi.GPIO Library on Eclipse (mac)

You could use GPIO Zero's remote GPIO feature: https://gpiozero.readthedocs.io/en/stab ... _gpio.html
by ben_nuttall
Wed Apr 17, 2019 6:55 pm
Forum: Python
Topic: Updating Scipy 0.18 version to 1.2.1
Replies: 2
Views: 218

Re: Updating Scipy 0.18 version to 1.2.1

Code: Select all

sudo pip3 install scipy --upgrade
by ben_nuttall
Fri Mar 29, 2019 9:28 pm
Forum: Python
Topic: simulate run program
Replies: 5
Views: 311

Re: simulate run program

You can use mock pins provided by GPIO Zero. First open a terminal and set an environment variable: export GPIOZERO_PIN_FACTORY=mock Then open a Python prompt (or an IDE): python3 or idle3 & (for example) Now when you do GPIO stuff with GPIO Zero it's not touching the pins, and you can simulate butt...
by ben_nuttall
Mon Mar 25, 2019 4:36 pm
Forum: Python
Topic: Raspberry Pi3 project using GPIO and LEDs
Replies: 21
Views: 1006

Re: Raspberry Pi3 project using GPIO and LEDs

Just tried to set an output using LED in gpiozero and then read its state using Button set to the same pin to read the LED state, causes an error because the pin is already in use by LED when the Button set up is attempted. You're trying to use an LED object to light an LED, and then a Button objec...
by ben_nuttall
Mon Mar 25, 2019 4:34 pm
Forum: Python
Topic: Raspberry Pi3 project using GPIO and LEDs
Replies: 21
Views: 1006

Re: Raspberry Pi3 project using GPIO and LEDs

Simple wrote:
Mon Mar 25, 2019 2:35 pm
This is something that I would like to do and am wondering if I would be better off working with RPi.GPIO
Why?
by ben_nuttall
Sun Mar 24, 2019 12:08 pm
Forum: Python
Topic: Raspberry Pi3 project using GPIO and LEDs
Replies: 21
Views: 1006

Re: Raspberry Pi3 project using GPIO and LEDs

Use PingServer and LED or PWMLED in GPIO Zero: https://gpiozero.readthedocs.io/en/stable/api_output.html#led https://gpiozero.readthedocs.io/en/stable/api_output.html#pwmled https://gpiozero.readthedocs.io/en/stable/api_internal.html#pingserver led.blink() # on / off every second led.blink(2, 2) # o...
by ben_nuttall
Fri Mar 15, 2019 10:00 pm
Forum: Python
Topic: installing gattlib for python3?
Replies: 1
Views: 774

Re: installing gattlib for python3?

It looks like some apt package which provides bluetooth.h will fix it. I'm tracking this in the piwheels issue tracker: https://github.com/bennuttall/piwheels/issues/129
by ben_nuttall
Fri Mar 15, 2019 9:53 pm
Forum: Python
Topic: Install pymc3
Replies: 3
Views: 471

Re: Install pymc3

Try:

Code: Select all

sudo pip3 install pymc3 -i https://www.piwheels.org/simple
by ben_nuttall
Fri Mar 15, 2019 12:42 am
Forum: Python
Topic: Install pymc3
Replies: 3
Views: 471

Re: Install pymc3

Are you trying to install for Python 2 or Python 3? And are you using Jessie or Stretch?

piwheels.org has wheels for pymc3 but only for Python 3.5 (Stretch).

So on Stretch, try:

Code: Select all

sudo pip3 install pymc3
and that should install it.
by ben_nuttall
Fri Mar 15, 2019 12:36 am
Forum: Python
Topic: GPIOzero button Migrating from RPi.GPIO
Replies: 1
Views: 356

Re: GPIOzero button Migrating from RPi.GPIO

You can't pull-down GPIO2 or GPIO3 as there are physical pull-up resistors on those pins. Try just using the button on its own and see if you can get the right results: from gpiozero import Button button = Button(2) while True: if button.is_pressed: print("pressed") else: print("released") If that w...
by ben_nuttall
Fri Mar 15, 2019 12:26 am
Forum: Python
Topic: picamera installation location varies - why?
Replies: 5
Views: 443

Re: picamera installation location varies - why?

With respect, that's just what @pootle said in the initial post... It's not. He said when it's pre-installed on Raspbian desktop, it's in A, when you install it on Raspbian Lite, it goes in B. I clarified that it depends how you install it, not which version of the OS you're on. I think the vital p...
by ben_nuttall
Wed Mar 13, 2019 4:50 pm
Forum: Python
Topic: picamera installation location varies - why?
Replies: 5
Views: 443

Re: picamera installation location varies - why?

If you install it with apt it ends up in /usr/lib/python3/dist-packages/picamera/

If you install it with pip it ends up in /usr/local/lib/python3.5/dist-packages/picamera/

The pre-installed version (in Raspbian desktop) is managed by apt.
by ben_nuttall
Sun Mar 10, 2019 1:25 am
Forum: Python
Topic: @property
Replies: 7
Views: 530

Re: @property

Why would they call themselves infinitely? Imagine the following regular function: def foo(bar): return "hello " + foo(bar) This would call itself indefinitely and trigger a RecursionError. What I did with the property first was define the foo attribute as "look up _foo and return that". That's fin...
by ben_nuttall
Thu Mar 07, 2019 4:37 pm
Forum: Python
Topic: @property
Replies: 7
Views: 530

Re: @property

That example is a pattern for providing getter/setter with logic but you're saving the value in a "private" attribute with the same name. I say "private" because it's not really private, they could still write to it with f._foo = "blah" but the public API is given as f.foo. Without using _foo: @prop...

Go to advanced search