Skip to content

python 3.14, ImportError #308

Closed
Closed

Description

@amirreza-sf80

hi!
so today we tried to add python 3.14 to our github action, and we're facing an error that seems to be comming from this package

django_valkey/compressors/lz4.py:1: in <module>
    from lz4.frame import compress
.venv/lib/python3.14/site-packages/lz4/frame/__init__.py:30: in <module>
    from . import _compression
E   ImportError: cannot import name '_compression' from partially initialized module 'lz4.frame' (most likely due to a circular import) (/home/runner/work/django-valkey/django-valkey/.venv/lib/python3.14/site-packages/lz4/frame/__init__.py)

if this is a problem on our side, i would be thankful to get a hint 🙌
but it works with all the other python versions

i understand that you don't yet support 3.14, just opening this for a heads up

django-commons/django-valkey#49
this is the pr that adds 3.14, if you need to see the full thing

Activity

  1. added a commit that references this issue on Sep 24, 2025
  2. cclauss commented on Sep 24, 2025

    @cclauss
    Contributor

    % uvx --with=lz4 python3.14t -c"import lz4"

    <frozen importlib._bootstrap>:491: RuntimeWarning: The global interpreter lock (GIL) has been enabled
        to load module 'lz4._version', which has not declared that it can run safely without the GIL.
        To override this behavior and keep the GIL disabled (at your own risk), run with PYTHON_GIL=0
        or -Xgil=0.
    

    Duplicate of:

  3. amirreza-sf80 commented on Sep 24, 2025

    @amirreza-sf80
    Author

    ah
    sorry, didn't see that

  4. cclauss commented on Oct 20, 2025

    @cclauss
    Contributor

    Is this fixed on the master branch?

  5. added a commit that references this issue on Oct 20, 2025
  6. added a commit that references this issue on Oct 20, 2025
  7. ikrommyd commented on Oct 31, 2025

    @ikrommyd

    Is this fixed on the master branch?

    Looks okay to me on my machine.

    ~ via  v3.14.0 via 󰏗 v0.56.0
    ❯ uv venv --python=3.14
    Using CPython 3.14.0 interpreter at: /opt/homebrew/opt/python@3.14/bin/python3.14
    Creating virtual environment at: .venv
    Activate with: source .venv/bin/activate
    
    ~ via  v3.14.0 via 󰏗 v0.56.0
    ❯ source .venv/bin/activate
    
    ~ via  v3.14.0 (iason) via 󰏗 v0.56.0
    ❯ uv pip install 'git+https://github.com/python-lz4/python-lz4'
    Resolved 1 package in 243ms
    Installed 1 package in 2ms
     + lz4==4.4.5.dev23+g59b2d8176 (from git+https://github.com/python-lz4/python-lz4@59b2d8176072bdee50d38cc68ec65c33b928a980)
    
    ~ via  v3.14.0 (iason) via 󰏗 v0.56.0
    ❯ python
    Python 3.14.0 (main, Oct  7 2025, 09:34:52) [Clang 17.0.0 (clang-1700.3.19.1)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from lz4.frame import compress
    >>>
    
  8. cclauss commented on Nov 3, 2025

    @cclauss
    Contributor

    Fixed in v4.4.5? https://github.com/python-lz4/python-lz4/releases --> https://pypi.org/project/lz4

    This now works:
    % uvx --with=lz4 python3.14t -c"from lz4.frame import compress"

  9. cclauss commented on Dec 1, 2025

    @cclauss
    Contributor

    @amirreza8002 Are you still blocked on this issue or can it be closed?

  10. amirreza-sf80 commented on Dec 1, 2025

    @amirreza-sf80
    Author

    yup
    seems ok

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

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