Unresolved reference 'micropython' in PyCharm

The following import is yielding 2 errors in the file editor:

from micropython import const

  • Unresolved reference ‘micropython’
  • Unresolved reference ‘const’

The “micropython” one I can set PyCharm to ignore, but the “const” one doesn’t have the same option.

I can build the project and run it on the XBee, but it is quite inconvenient specially because on every build there is an additional popup that I have to interact with:

Inspection found the following errors:

- Unresolved reference ‘const’ (main.py)

Do you want to continue?

-> I have to click on “Continue Anyway”

PyCharm 2022.2.1
Digi XBee Plugin 2.1.4 (latest available as of today)

I would suggest https://docs.micropython.org/en/latest/library/micropython.html

What “worked” in the end was to remove the import: “from micropython import const”, then on each class that uses ‘const’, tell PyCharm to ignore the unresolved reference ‘const’.