Skip to content

Python 3.12.12 standalone has an error with libraries that depend on bz2 #818

@ross-c-swyftx

Description

@ross-c-swyftx

Hello,

In our CI/CD system we use mise to lock tool version dependencies. A program we run in CI/CD executes fine with python 3.12.11, which mise downloads from uv's releases built from this repository. I can't see 3.12.12 in this repository yet, so I'm not sure this is the right location for the bug.

After python 3.12.12 has been released, we get an error running the same program:

Using CPython 3.12.12 interpreter at: /home/runner/.local/share/mise/installs/python/3.12.12/bin/python3.12
Creating virtual environment at: .venv
   Building tgtree @ file:///home/runner/work/platform/platform/tools/tgtree
Downloading pygments (1.2MiB)
Downloading networkx (1.9MiB)
Downloading ruff (12.5MiB)
      Built tgtree @ file:///home/runner/work/platform/platform/tools/tgtree
 Downloading ruff
 Downloading pygments
 Downloading networkx
Installed 21 packages in 18ms
Traceback (most recent call last):
  File "/home/runner/work/platform/platform/tools/tgtree/.venv/bin/tgtree", line 4, in <module>
    from tgtree.main import app
  File "/home/runner/work/platform/platform/tools/tgtree/src/tgtree/__init__.py", line 1, in <module>
    from .main import app
  File "/home/runner/work/platform/platform/tools/tgtree/src/tgtree/main.py", line 6, in <module>
    import networkx as nx
  File "/home/runner/work/platform/platform/tools/tgtree/.venv/lib/python3.12/site-packages/networkx/__init__.py", line 19, in <module>
    from networkx import utils
  File "/home/runner/work/platform/platform/tools/tgtree/.venv/lib/python3.12/site-packages/networkx/utils/__init__.py", line 2, in <module>
    from networkx.utils.decorators import *
  File "/home/runner/work/platform/platform/tools/tgtree/.venv/lib/python3.12/site-packages/networkx/utils/decorators.py", line 1, in <module>
    import bz2
  File "/home/runner/.local/share/mise/installs/python/3.12.12/lib/python3.12/bz2.py", line 17, in <module>
    from _bz2 import BZ2Compressor, BZ2Decompressor
ModuleNotFoundError: No module named '_bz2'

Previously, this ran fine with 3.12.11:

Run # Generate the exhaustive metadata used to identify changes for the purpose of debugging
Using CPython 3.12.11 interpreter at: /home/runner/.local/share/mise/installs/python/3.12.11/bin/python3.12
Creating virtual environment at: .venv
   Building tgtree @ file:///home/runner/work/platform/platform/tools/tgtree
Downloading pygments (1.2MiB)
Downloading networkx (1.9MiB)
Downloading ruff (12.5MiB)
 Downloading ruff
 Downloading pygments
      Built tgtree @ file:///home/runner/work/platform/platform/tools/tgtree
 Downloading networkx
Installed 21 packages in 21ms
Run actions/upload-artifact@v4

Something is wrong with the bz2 package in your standalone build of python 3.12.12, was it compiled on a system with libbz2?

Locking our runner version to 3.12.11 fixed the issue.

Cheers!

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