Can't build package because it needs glibc 2.34 (older than what is installed)

I’m not sure if this comes from the way the requirements are written or the way my repl is configured, but I need to install this custom package from github and it is complaining about the glibc version:

 pip install -U git+https://github.com/pamelafox/flask-sqlalchemy.git@mixin-three
Looking in indexes: https://package-proxy.replit.com/pypi/simple/
Collecting git+https://github.com/pamelafox/flask-sqlalchemy.git@mixin-three
  Cloning https://github.com/pamelafox/flask-sqlalchemy.git (to revision mixin-three) to /tmp/pip-req-build-53pt99ym
  Running command git clone -q https://github.com/pamelafox/flask-sqlalchemy.git /tmp/pip-req-build-53pt99ym
  git: /nix/store/s9qbqh7gzacs7h68b2jfmn9l6q4jwfjz-glibc-2.33-59/lib/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/mdck89nsfisflwjv6xv8ydj7dj0sj2pn-gcc-11.3.0-lib/lib/libgcc_s.so.1)
WARNING: Discarding git+https://github.com/pamelafox/flask-sqlalchemy.git@mixin-three. Command errored out with exit status 1: git clone -q https://github.com/pamelafox/flask-sqlalchemy.git /tmp/pip-req-build-53pt99ym Check the logs for full command output.
ERROR: Command errored out with exit status 1: git clone -q https://github.com/pamelafox/flask-sqlalchemy.git /tmp/pip-req-build-53pt99ym Check the logs for full command output.

Checking version, I don’t see why there is an issue as it should be backwards-compatible, right?

~/Flask-basic$ ldd --version
ldd (GNU libc) 2.35
$Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$Written by Roland McGrath and Ulrich Drepper.

Edit: I tried putting "glibc-2.34-210" in my repl.nix file, but ldd still shows the same version:

{ pkgs }: {
  deps = [
    pkgs.midori-unwrapped
    pkgs.palemoon
    pkgs.firefox-esr
    pkgs.python310Full
    pkgs.replitPackages.prybar-python310
    pkgs.replitPackages.stderred
    pkgs.clang_12
    pkgs.ccls
    pkgs.gdb
    pkgs.gnumake
  ];
  env = {
    PYTHON_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
      # Needed for pandas / numpy
      pkgs.stdenv.cc.cc.lib
      pkgs.zlib
      # Needed for pygame
      pkgs.glib
      # Needed for matplotlib
      pkgs.xorg.libX11
      "glibc-2.34-210"
    ];
    PYTHONHOME = "${pkgs.python310Full}";
    PYTHONBIN = "${pkgs.python310Full}/bin/python3.10";
    LANG = "en_US.UTF-8";
    STDERREDBIN = "${pkgs.replitPackages.stderred}/bin/stderred";
    PRYBAR_PYTHON_BIN = "${pkgs.replitPackages.prybar-python310}/bin/prybar-python310";
  };
}

Also, the error mentions glibc-2.33-59, so not sure what is actually going on here.

Ah yes, I hate when this happens too. The problem here is actually the version of git, not glibc. So

Try removing that and put pkgs.git instead to update the git version.

3 Likes

Still get the same error. Is there a specific git version I should specify?

Can you link the repl? Did you restart it using kill 1 in shell?

1 Like

Unfortunately that did not help. Repl here: https://replit.com/@Stonecraft/Flask-basic

looking at your repl, you put pkgs.git in the wrong spot. It should be in deps = not PYTHON_LD_LIBRARY_PATH = (As it has nothing to do with python)

2 Likes

There we go, thank you!

1 Like

This now works on with the latest python setup.

You can start a new Python Repl, or do the following

Here’s the .replit file

entrypoint = "main.py"
modules = ["python-3.10:v18-20230807-322e88b"]

hidden = [".pythonlibs"]

[nix]
channel = "stable-23_05"

[deployment]
run = ["python3", "main.py"]
deploymentTarget = "cloudrun"

And you then delete replit.nix or empty it like so

{ pkgs }: {
  deps = [
  ];
}

Additionally, we recommend using poetry over pip.

Let me know if you run into issues.

1 Like