Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-python/gpiozero is missing colorzero dependency #22

Closed
denilsonsa opened this issue Jul 27, 2020 · 3 comments
Closed

dev-python/gpiozero is missing colorzero dependency #22

denilsonsa opened this issue Jul 27, 2020 · 3 comments
Assignees

Comments

@denilsonsa
Copy link

How to reproduce:

I have Gentoo arm64 running on Raspberry Pi 4 B (installed using sakaki-/gentoo-on-rpi-64bit).

  1. Add HomeAssistantRepository to your portage overlays.

  2. emerge -av gpiozero

     [ebuild  N     ] dev-python/gpiozero-1.5.1::HomeAssistantRepository  USE="-test" PYTHON_TARGETS="python3_6 python3_7 -python3_8" 140 KiB
    
  3. Check if everything was installed: equery files gpiozero

     … Many files, but mostly: …
     /usr/bin/pinout -> ../lib/python-exec/python-exec2
     /usr/lib/python3.7/site-packages/gpiozero-1.5.1-py3.7.egg-info…
     /usr/lib/python3.7/site-packages/gpiozero/…
     /usr/lib/python3.7/site-packages/gpiozerocli/__init__.py
     /usr/lib/python3.7/site-packages/gpiozerocli/pinout.py
     /usr/lib64/python3.6/site-packages/gpiozero-1.5.1-py3.6.egg-info/…
     /usr/lib64/python3.6/site-packages/gpiozero/…
     /usr/lib64/python3.6/site-packages/gpiozerocli/__init__.py
     /usr/lib64/python3.6/site-packages/gpiozerocli/pinout.py
    
  4. Try running the gpiozerocli tool: pinout

What happens:

$  pinout
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.7/pinout", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3251, in <module>
    @_call_aside
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3235, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3264, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'colorzero' distribution was not found and is required by gpiozero

What should happen:

It should printout a text-based pinout on the terminal. Look at the screenshots:

Alternative way to trigger the issue:

$ ipython
Python 3.7.8 (default, Jul  2 2020, 17:08:45)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.16.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import gpiozero
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-d4c0b0396b91> in <module>
----> 1 import gpiozero

/usr/lib/python3.7/site-packages/gpiozero/__init__.py in <module>
     95     MCP3304,
     96 )
---> 97 from .output_devices import (
     98     OutputDevice,
     99     DigitalOutputDevice,

/usr/lib/python3.7/site-packages/gpiozero/output_devices.py in <module>
     43 from threading import Lock
     44 from itertools import repeat, cycle, chain
---> 45 from colorzero import Color
     46 from collections import OrderedDict
     47 try:

ModuleNotFoundError: No module named 'colorzero'

Why it happens:

Because gpiozero depends on colorzero python module.

Solution:

Someone has to write an ebuild for colorzero, add it to the overlay, and add it as dependency of gpiozero (since version 1.5.0).

@denilsonsa denilsonsa changed the title dev-python/gpiozero: pinout cli tool doesn't work dev-python/gpiozero is missing colorzero dependency Jul 27, 2020
@onkelbeh onkelbeh self-assigned this Jul 28, 2020
@onkelbeh
Copy link
Owner

Oh, missed that one, they added it in 1.5.0
Should be fixed with 71c1eb5.

Did not test on arm, yet. But I have plans for that.
For now the modules are OK for me if they compile on amd64.
Thanks for that impressive bug report :-)

One question: Did you set up a cross compiler?

@denilsonsa
Copy link
Author

No, I did not set up any cross-compiler! Since I don't have any other Gentoo system around here, the Raspberry Pi 4 is either downloading binaries, or compiling stuff by itself.

Also, I don't plan running homeassistant on gentoo (I have a dedicated Pi just for hass.io); I just found your overlay because I was curious about the gpiozero module.

@onkelbeh
Copy link
Owner

Thanks for the info. Too bad this returns the amount of known arm64 users back to one :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants