Skip to content

Unexpected switch to GraalPy causing PyTorch C-extension import error #1

@VaralikaAg

Description

@VaralikaAg

I'm encountering a strange issue when running trainModifyCondition.py.

When I start Python, my environment is expected to use Python 3.10.x (CPython).
However, during execution, it unexpectedly switches to GraalPy 3.10.8 (GraalVM CE JVM 23.0.0), which causes PyTorch to fail loading C extensions.

Here is the exact error:

ImportError: Failed to load PyTorch C extensions:
    It appears that PyTorch has loaded the `torch/_C` folder
    of the PyTorch repository rather than the C extensions which
    are expected in the `torch._C` namespace.

After that, checking the Python version shows:

python --version
GraalPy 3.10.8 (GraalVM CE JVM 23.0.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions