Skip to content

Python 3.14 Missing Built-in Modules for Pandas #5713

@machani-paul007

Description

@machani-paul007

Bug Description

When using PyO3 0.27.2 with Python 3.14.0, built-in Python modules fail to import, causing cascading failures for any package that depends on them (numpy, pandas, etc.). The same code works correctly with Python 3.13.

Built-in modules like math, _struct, _posixsubprocess, sys, os are missing when Python is initialized via PyO3 with Python 3.14. These are core C extension modules that should always be available.

ModuleNotFoundError: No module named 'math'
ModuleNotFoundError: No module named '_struct'

Is Python 3.14 support experimental in PyO3 0.27.2?
Are there Python 3.14-specific initialization requirements?
Is this a known issue? workarounds any ?
What's the recommended approach?

Steps to Reproduce

Simple Test cases repo to replicate same issue with Pandas.
official whl files are pulled from https://pypi.org/project/pandas/#files

https://github.com/machani-paul007/pyo3-whl-tests

Backtrace

Your operating system and version

Ubuntu v24 LTS

Your Python version (python --version)

py 3.13.10 / py 3.14.0

Your Rust version (rustc --version)

1.91.0

Your PyO3 version

0.27.2

How did you install python? Did you use a virtualenv?

Using uv venv

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions