Skip to content

[Bug]: ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory #710

@StephenStrickland

Description

@StephenStrickland

Current Behavior (bug)
When using python packages like gradio the package fails when calling into pandas.

Steps:

  1. > devbox shell
  2. > gradio

Error Message

> gradio
Traceback (most recent call last):
  File "/home/stephen/code/poc/.devbox/virtenv/python310Packages.pip/.venv/bin/gradio", line 5, in <module>
    from gradio.reload import run_in_reload_mode
  File "/home/stephen/code/poc/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/gradio/__init__.py", line 3, in <module>
    import gradio.components as components
  File "/home/stephen/code/poc/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/gradio/components.py", line 21, in <module>
    import altair as alt
  File "/home/stephen/code/poc/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/altair/__init__.py", line 4, in <module>
    from .vegalite import *
  File "/home/stephen/code/poc/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/altair/vegalite/__init__.py", line 2, in <module>
    from .v4 import *
  File "/home/stephen/code/poc/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/altair/vegalite/v4/__init__.py", line 2, in <module>
    from .schema import *
  File "/home/stephen/code/poc/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/altair/vegalite/v4/schema/__init__.py", line 2, in <module>
    from .core import *
  File "/home/stephen/code/poc/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/altair/vegalite/v4/schema/core.py", line 4, in <module>
    from altair.utils.schemapi import SchemaBase, Undefined, _subclasses
  File "/home/stephen/code/poc/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/altair/utils/__init__.py", line 1, in <module>
    from .core import (
  File "/home/stephen/code/poc/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/altair/utils/core.py", line 14, in <module>
    import pandas as pd
  File "/home/stephen/code/poc/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/pandas/__init__.py", line 48, in <module>
    from pandas.core.api import (
  File "/home/stephen/code/poc/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/pandas/core/api.py", line 47, in <module>
    from pandas.core.groupby import (
  File "/home/stephen/code/poc/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/pandas/core/groupby/__init__.py", line 1, in <module>
    from pandas.core.groupby.generic import (
  File "/home/stephen/code/poc/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/pandas/core/groupby/generic.py", line 76, in <module>
    from pandas.core.frame import DataFrame
  File "/home/stephen/code/poc/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/pandas/core/frame.py", line 172, in <module>
    from pandas.core.generic import NDFrame
  File "/home/stephen/code/poc/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/pandas/core/generic.py", line 169, in <module>
    from pandas.core.window import (
  File "/home/stephen/code/poc/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/pandas/core/window/__init__.py", line 1, in <module>
    from pandas.core.window.ewm import (
  File "/home/stephen/code/poc/.devbox/virtenv/python310Packages.pip/.venv/lib/python3.10/site-packages/pandas/core/window/ewm.py", line 15, in <module>
    import pandas._libs.window.aggregations as window_aggregations
ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory

Expected Behavior (fix)
Running gradio from devbox shell should not return this error.

This exact error message is listed as a quirk in Nix docs: https://nixos.wiki/wiki/Packaging/Quirks_and_Caveats#ImportError:_libstdc.2B.2B.so.6:_cannot_open_shared_object_file:_No_such_file

Additional context
machine: Windows 10 running Ubuntu WSL2
version: 0.4.1
./devbox.json:

{
  "packages": [
    "python310",
    "python310Packages.pip"
  ],
  "shell": {
    "init_hook": [
      "source $VENV_DIR/bin/activate",
      "pip install -r requirements.txt"
    ]
  },
  "nixpkgs": {
    "commit": "f80ac848e3d6f0c12c52758c0f25c10c97ca3b62"
  }
}

./requirements.txt:

fastapi
gradio
requests
ruff

Note:
This bug is reproducible with pip and poetry. Based devbox.json on example repos from docs.

Workaround

  1. Manually add pandas: devbox add python310Packages.pandas
  2. Refresh shell

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingglibcRelated to linking against glibclinkerRelated to linking (ld, ld.so or dyld)linuxLinux systemspythonSupport for Python, pip, Poetry, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions