Skip to content

Failing to use / import apigpio  #13

@arthurlutz

Description

@arthurlutz

From missionpinball/mpf#1427

File "/usr/local/lib/python3.7/dist-packages/mpf/core/machine.py", line 212, in initialise
    yield from self.initialise_core_and_hardware()
  File "/usr/local/lib/python3.7/dist-packages/mpf/core/machine.py", line 197, in initialise_core_and_hardware
    self._load_hardware_platforms()
  File "/usr/local/lib/python3.7/dist-packages/mpf/core/machine.py", line 497, in _load_hardware_platforms
    self.add_platform(hardware_platform)
  File "/usr/local/lib/python3.7/dist-packages/mpf/core/machine.py", line 614, in add_platform
    hardware_platform = Util.string_to_class(self.config['mpf']['platforms'][name])
  File "/usr/local/lib/python3.7/dist-packages/mpf/core/utility_functions.py", line 588, in string_to_class
    m = __import__(module)
  File "/usr/local/lib/python3.7/dist-packages/mpf/platforms/rpi/rpi.py", line 20, in <module>
    import apigpio
  File "/usr/local/lib/python3.7/dist-packages/apigpio/__init__.py", line 2, in <module>
    from .apigpio import Pi

I then go on to try to import apigpio from python2 and python3 and get :

pi@pizerow:~/mpf $ python3
Python 3.7.3 (default, Apr  3 2019, 05:39:12) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import apigpio
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/dist-packages/apigpio/__init__.py", line 2, in <module>
    from .apigpio import Pi
  File "/usr/local/lib/python3.7/dist-packages/apigpio/apigpio.py", line 390
    asyncio.async(self._wait_for_notif())
                ^
SyntaxError: invalid syntax
>>> 
pi@pizerow:~/mpf $ python
Python 2.7.16 (default, Apr  6 2019, 01:42:57) 
[GCC 8.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import apigpio
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/apigpio/__init__.py", line 2, in <module>
    from .apigpio import Pi
  File "/usr/local/lib/python2.7/dist-packages/apigpio/apigpio.py", line 388
    yield from self._loop.sock_connect(self.s, address)
             ^
SyntaxError: invalid syntax
>>> 

Seeing from .apigpio import Pi I was looking for a Pi.py in /usr/local/lib/python3.7/dist-packages/apigpio/ but couldn't fit it :

ls /usr/local/lib/python3.7/dist-packages/apigpio/
__init__.py  __pycache__  apigpio.py  ctes.py  utils.py
ls /usr/local/lib/python2.7/dist-packages/apigpio/
__init__.py  __init__.pyc  apigpio.py  ctes.py  ctes.pyc  utils.py  utils.pyc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions