Skip to content

After upgrading Python from 3.12.5 to 3.13: Missing _version.py file in lz4 package causing ModuleNotFoundError #290

Open

Description

@SparklingTopaz

Hello everyone,

I am experiencing an issue with the lz4 package in Python. After reinstalling Python and the lz4 library, I encountered a ModuleNotFoundError related to a missing _version.py file. I've upgraded from Python version 3.12.5 to 3.13.

Here’s a summary of my setup and the steps I’ve taken:
Environment Details:

Python Version: 3.13
Operating System: Windows 10
Installed Packages: lz4, browser_cookie3

Error Message:

When running my script, I receive the following error:

ModuleNotFoundError: No module named 'lz4._version'

This error occurs specifically in the browser_cookie3 package, which attempts to import lz4.block.

Steps Taken:

Checked for Installation of lz4:
I verified that lz4 is installed using pip show lz4. It confirmed the installation but did not indicate the presence of the _version.py file.

Reinstalled lz4:
I uninstalled and reinstalled the package using:

pip uninstall lz4
pip install lz4

Checked the Installation Directory:
I navigated to the lz4 installation directory (e.g., C:\Program Files\Python313\Lib\site-packages\lz4) but did not find the _version.py file.

Tried Installing Different Versions:
I attempted to install older versions of lz4, but the issue persisted with the missing file.

Explored Alternative Installation:
I considered downloading the lz4 package directly from GitHub, but I wanted to check if anyone else has encountered this issue and found a solution.

Request for Help:

If anyone has experienced similar issues or knows how to resolve this problem, I would greatly appreciate your guidance. Is there a specific reason why _version.py is missing in my installation? Any help would be invaluable!

Thank you for your time!

Activity

  1. sacrificerXY commented on Dec 20, 2024

    @sacrificerXY

    Idk how this all works but in my case, I've cloned the repo and manually done pip install/pip wheel while also modifying this part:

    python-lz4/setup.py

    Lines 70 to 75 in 546d6d5

    use_system_liblz4_env = os.environ.get("PYLZ4_USE_SYSTEM_LZ4", "True")
    if use_system_liblz4_env.upper() in ("1", "TRUE"):
    use_system_liblz4 = True
    else:
    use_system_liblz4 = False

    I just uncommented that whole section and added an extra line that forced use_system_liblz4 to False.

    Again, I'm not at all familiar with any of these things so I'm not sure what side-effects this will have.

  2. cclauss commented on Oct 23, 2025

    @cclauss
    Contributor

    Is this still happening in the current release?

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