Skip to content

[FEATURE] Python on NuttX: known issues, "TO-DO" list, and general enhancements #2884

Description

@tmedicci

Is your feature request related to a problem? Please describe.

After #2879 was merged, it's time to make Python on NuttX fully usable!

This issue intends to discuss the next steps required to make it fully functional, including a "To-Do" list and any discussions on how it would evolve to support other architectures and platforms.

Initial Considerations

  1. Python for NuttX target initially the rv-virt (RISC-V QEMU). That being said, its interpreters/python/config.site and interpreters/python/Setup.local are somehow tied with the features enabled by the boards/risc-v/qemu-rv/rv-virt/configs/cpython/defconfig. Python for NuttX depends on CONFIG_EXPERIMENTAL!
  2. Python modules are stored in pyc (byte-code format) and are loaded from a ROMFS image at startup.
  3. Environment variables like PYTHONHOME and PYTHON_BASIC_REPL needs to be set accordingly.

Describe the solution you'd like

TO-DO list:

This is the list of the next steps to make Python's port fully functional (sorted by highest priority):

  • Provide a CMake-based build: currently we can only build it using Make.
  • Generate interpreters/python/Setup.local and interpreters/python/config.site dynamically according to the enabled configs. For instance: export ac_cv_func_pipe="yes" depends on CONFIG_PIPES being enabled.
  • Create a wrapper application to automate the 1) mounting the ROMFS image with the Python's modules, 2) setting the environment variables and 3) running the Program/python.c app.
  • Support Python's socket module. This is one of the most important modules to enable Python applications with POSIX-compatible sockets .

Known Issues

Describe alternatives you've considered

No response

Verification

  • I have verified before submitting the report.

Activity

  1. self-assigned this
    on Dec 9, 2024
  2. changed the title [-][FEATURE] Python on NuttX: "To-Do" list and general enhancements[/-] [+][FEATURE] Python on NuttX: Known Issues, "To-Do" list, and general enhancements[/+] on Dec 9, 2024
  3. changed the title [-][FEATURE] Python on NuttX: Known Issues, "To-Do" list, and general enhancements[/-] [+][FEATURE] Python on NuttX: known issues, "TO-DO" list, and general enhancements[/+] on Dec 9, 2024
  4. tmedicci commented on Jan 7, 2025

    @tmedicci
    ContributorAuthor

    Update: Python's socket module is now supported and Python on NuttX can run applications with POSIX-compatible sockets. Please check apache/nuttx#15457 and #2928 for examples.

  5. tmedicci commented on Jan 8, 2025

    @tmedicci
    ContributorAuthor

    Hi, I prepared an article with the technical details of the implementation in my blog. You can check it at:

    https://tmedicci.github.io/articles/2025/01/08/python_on_nuttx.html

  6. pinned this issue on Jan 31, 2025
  7. tmedicci commented on Jan 31, 2025

    @tmedicci
    ContributorAuthor

    Just submitted a new PR (#2982) that solves two issues on TO-DO list:

    1. Generate interpreters/python/Setup.local and interpreters/python/config.site dynamically according to the enabled configs. For instance: export ac_cv_func_pipe="yes" depends on CONFIG_PIPES being enabled.
    2. Create a wrapper application to automate the 1) mounting the ROMFS image with the Python's modules, 2) setting the environment variables and 3) running the Program/python.c app.
  8. moved this to In Progress in Apache NuttX RTOSon Jan 31, 2025
  9. tmedicci commented on Mar 7, 2025

    @tmedicci
    ContributorAuthor

    Just submitted the support for running Python on ESP32-S3: apache/nuttx#15955

    Please check the following article for more detailed explanation and example: Running Python on ESP32-S3 with NuttX

  10. tmedicci commented on May 18, 2026

    @tmedicci
    ContributorAuthor

    Update: pip support was enabled for RISC-V QEMU at #3487

    (Still need help to make it run faster and lower its final size on flash)

  11. arnavsharma990 commented on Sep 17, 2026

    @arnavsharma990
    Contributor

    Hi @tmedicci — #2884 lists "Provide a CMake-based build" unchecked... May I take the CMake piece as a focused nuttx-apps-only PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions