pimoroni / fanshim-python

Python library for the Fan SHIM for Raspberry Pi
https://shop.pimoroni.com/products/fan-shim
MIT License
295 stars 86 forks source link

import fanshim crash #107

Closed dchmelik closed 2 years ago

dchmelik commented 2 years ago

On Slackware-ARM32 15 Raspberry Pi 3, installation worked but importing fanshim crashes something. Maybe it only works on RaspiOS?

root@1.darkelfheim:~# python3
Python 3.9.10 (main, Jan 17 2022, 21:15:54) 
[GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from fanshim import FanShim
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 982, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 925, in _find_spec
  File "<frozen importlib._bootstrap_external>", line 1414, in find_spec
  File "<frozen importlib._bootstrap_external>", line 1388, in _get_spec
  File "<frozen importlib._bootstrap_external>", line 1369, in _legacy_get_spec
  File "<frozen importlib._bootstrap>", line 423, in spec_from_loader
  File "<frozen importlib._bootstrap_external>", line 716, in spec_from_file_location
  File "<frozen zipimport>", line 191, in get_filename
  File "<frozen zipimport>", line 713, in _get_module_code
  File "<frozen zipimport>", line 647, in _compile_source
  File "/usr/lib/python3.9/site-packages/fanshim-0.0.5-py3.9.egg/fanshim/__init__.py", line 1
    T, GPIO.HIGH)
                ^
SyntaxError: unmatched ')'
Gadgetoid commented 2 years ago

What are the contents of /usr/lib/python3.9/site-packages/fanshim-0.0.5-py3.9.egg/fanshim/__init__.py? It looks quite broken, corrupted maybe? There's no "GPIO.HIGH" in the library so it's weird it would be showing in an error message.

dchmelik commented 2 years ago

Actually the installation went wrong.