Skip to content

About Error SyntaxError: future feature annotations.... on python 3.6 #229

@ctm6100

Description

@ctm6100

about the Error

I am a Jetson user (using pyhton 3.6), for Adafruit_Python_PlatformDetect version bigger than 3.19.6
the following error wil be recived

>>> import board
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/board.py", line 39, in <module>
    import adafruit_platformdetect.constants.boards as ap_board
  File "/usr/local/lib/python3.6/dist-packages/adafruit_platformdetect/__init__.py", line 10, in <module>
    from .board import Board
  File "/usr/local/lib/python3.6/dist-packages/adafruit_platformdetect/board.py", line 24
    from __future__ import annotations
    ^
SyntaxError: future feature annotations is not defined

Issues

Maybe this due to the 3.20.0 added Type Annotations?
Therefore maybe the version that require Python 3.7 is starting from 3.20.0 instead of 3.21.0?

Possible quick fix for this issues

the solution that work for me (using python3.6)

  1. remove the current version(anything > 3.19.6)
    $sudo -H pip3 uninstall Adafruit-PlatformDetect
  2. specify the version to 3.19.6
    $sudo -H pip3 install Adafruit-PlatformDetect==3.19.6

OR
try backport of future annotations(not yet test)
OR
update to python3.7(painful in jetson)(not yet test)

image
image

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