I am trying to run nix-shell to use poetry (and hopefully poetry2nix). I am stuck with an error from an executable from a python package that claims libstdc++ is missing.
So how to I refer to this variable in shell.nix? I’ve tried to add stdenv like { stdenv, pkgs ? import … } but no luck. I need it to work both on Nix and on NixOS.
shell.nix now evaluates, but unfortunately I still get the same error. Seems like the solution I linked to wasn’t enough.
The error message I get is:
(python-fmri-env-py3.10) espen@mainframe-ubuntu:~/code/python-fmri-env$ clinica
Traceback (most recent call last):
File "/home/espen/.cache/pypoetry/virtualenvs/python-fmri-env-5taD3dGB-py3.10/bin/clinica", line 5, in <module>
from clinica.cmdline import main
File "/home/espen/.cache/pypoetry/virtualenvs/python-fmri-env-5taD3dGB-py3.10/lib/python3.10/site-packages/clinica/cmdline.py", line 13, in <module>
from clinica.iotools.converters.cli import cli as convert_cli
File "/home/espen/.cache/pypoetry/virtualenvs/python-fmri-env-5taD3dGB-py3.10/lib/python3.10/site-packages/clinica/iotools/converters/cli.py", line 5, in <module>
from .habs_to_bids import habs_to_bids_cli
File "/home/espen/.cache/pypoetry/virtualenvs/python-fmri-env-5taD3dGB-py3.10/lib/python3.10/site-packages/clinica/iotools/converters/habs_to_bids/habs_to_bids_cli.py", line 5, in <module>
import clinica.iotools.bids_utils as bids
File "/home/espen/.cache/pypoetry/virtualenvs/python-fmri-env-5taD3dGB-py3.10/lib/python3.10/site-packages/clinica/iotools/bids_utils.py", line 7, in <module>
from pandas import DataFrame
File "/home/espen/.cache/pypoetry/virtualenvs/python-fmri-env-5taD3dGB-py3.10/lib/python3.10/site-packages/pandas/__init__.py", line 48, in <module>
from pandas.core.api import (
File "/home/espen/.cache/pypoetry/virtualenvs/python-fmri-env-5taD3dGB-py3.10/lib/python3.10/site-packages/pandas/core/api.py", line 47, in <module>
from pandas.core.groupby import (
File "/home/espen/.cache/pypoetry/virtualenvs/python-fmri-env-5taD3dGB-py3.10/lib/python3.10/site-packages/pandas/core/groupby/__init__.py", line 1, in <module>
from pandas.core.groupby.generic import (
File "/home/espen/.cache/pypoetry/virtualenvs/python-fmri-env-5taD3dGB-py3.10/lib/python3.10/site-packages/pandas/core/groupby/generic.py", line 76, in <module>
from pandas.core.frame import DataFrame
File "/home/espen/.cache/pypoetry/virtualenvs/python-fmri-env-5taD3dGB-py3.10/lib/python3.10/site-packages/pandas/core/frame.py", line 172, in <module>
from pandas.core.generic import NDFrame
File "/home/espen/.cache/pypoetry/virtualenvs/python-fmri-env-5taD3dGB-py3.10/lib/python3.10/site-packages/pandas/core/generic.py", line 169, in <module>
from pandas.core.window import (
File "/home/espen/.cache/pypoetry/virtualenvs/python-fmri-env-5taD3dGB-py3.10/lib/python3.10/site-packages/pandas/core/window/__init__.py", line 1, in <module>
from pandas.core.window.ewm import (
File "/home/espen/.cache/pypoetry/virtualenvs/python-fmri-env-5taD3dGB-py3.10/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
I get the same error both with Ubuntu/Nix and NixOS. Any ideas how to fix this?
Thank you, this solved a longstanding problem for me. Just for completness and for everybody who comes after me (especially myself a few weeks in the future), here is a complete shell.nix that works for me (you probably don’t need the unstable part):
For other readers, especially if you have multiple libraries you might consider lib.makeLibraryPath, which will combine its inputs properly and add the /lib for you. For example: