Skip to content

Cannot import in python 3.7 #76

Closed
@Neradoc

Description

@Neradoc
>>> import adafruit_rfm9x
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/circuit/venv/lib/python3.7/site-packages/adafruit_rfm9x.py", line 142, in <module>
    class RFM9x:
  File "/home/pi/circuit/venv/lib/python3.7/site-packages/adafruit_rfm9x.py", line 265, in RFM9x
    crc: bool = True
NameError: name 'SPI' is not defined

The real exception, hidden by the typing try-except is the following:

  File "/home/pi/circuit/venv/lib/python3.7/site-packages/adafruit_rfm9x.py", line 31, in <module>
    from typing import Optional, Type, Literal
ImportError: cannot import name 'Literal' from 'typing' (/usr/lib/python3.7/typing.py)

Literal is in python 3.8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions