Python ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory

Hi there!
I am having this issue with using Python pandas. It was working fine up until I moved my venv folder and broke it, so I had to reinstall the packages and since then I get this error.

Traceback (most recent call last):
  File "/home/nix/Desktop/Python/v21/v21.py", line 19, in <module>
    import pandas as pd
  File "/home/nix/Desktop/Python/venv_1/lib/python3.11/site-packages/pandas/__init__.py", line 46, in <module>
    from pandas.core.api import (
  File "/home/nix/Desktop/Python/venv_1/lib/python3.11/site-packages/pandas/core/api.py", line 47, in <module>
    from pandas.core.groupby import (
  File "/home/nix/Desktop/Python/venv_1/lib/python3.11/site-packages/pandas/core/groupby/__init__.py", line 1, in <module>
    from pandas.core.groupby.generic import (
  File "/home/nix/Desktop/Python/venv_1/lib/python3.11/site-packages/pandas/core/groupby/generic.py", line 67, in <module>
    from pandas.core.frame import DataFrame
  File "/home/nix/Desktop/Python/venv_1/lib/python3.11/site-packages/pandas/core/frame.py", line 142, in <module>
    from pandas.core.generic import (
  File "/home/nix/Desktop/Python/venv_1/lib/python3.11/site-packages/pandas/core/generic.py", line 187, in <module>
    from pandas.core.window import (
  File "/home/nix/Desktop/Python/venv_1/lib/python3.11/site-packages/pandas/core/window/__init__.py", line 1, in <module>
    from pandas.core.window.ewm import (
  File "/home/nix/Desktop/Python/venv_1/lib/python3.11/site-packages/pandas/core/window/ewm.py", line 11, in <module>
    import pandas._libs.window.aggregations as window_aggregations
ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory

Based on this page: Packaging/Quirks and Caveats - NixOS Wiki
I am supposed to create a shell.nix file that looks like this:

{ pkgs ? (import <nixpkgs> {}).pkgs }:
with pkgs;
mkShell {
  buildInputs = [
    python3Packages.virtualenv # run virtualenv .
    python3Packages.pyqt5 # avoid installing via pip
    python3Packages.pyusb # fixes the pyusb 'No backend available' when installed directly via pip
  ];
  shellHook = ''
    # fixes libstdc++ issues and libgl.so issues
    LD_LIBRARY_PATH=${stdenv.cc.cc.lib}/lib/:/run/opengl-driver/lib/
    # fixes xcb issues :
    QT_PLUGIN_PATH=${qt5.qtbase}/${qt5.qtbase.qtPluginPrefix}
  '';
}

I am mostly new to NixOS and I have no idea what shell.nix is… I also am unable to find any useful information on how to use it.
Could someone please assist to helping me understand how to implement this fix? Best case scenario is being able to add it to configuration.nix so it continues to be a 1 file solution.

I am using NixOS 23.11 (updated from 23.05), with a single configuration.nix file.

configuration.nix
{ config, lib, pkgs, ... }:

{
  system.autoUpgrade.enable = true;
  system.autoUpgrade.allowReboot = false;
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];

  #Laptop stuff
  # Enable touchpad support (enabled default in most desktopManager).
  # services.xserver.libinput.enable = true;

  # COMMENT IF NOT USING NVIDIA!!!!!! The below is all for Nvidia driver stuff

  # Laptop stuff
  #intel
  #boot.kernelParams = [ "module_blacklist=i915" ];
  #AMD
  #boot.kernelParams = [ "module_blacklist=amdgpu" ];
#   hardware.nvidia.prime = {
#       offload = {
#         enable = true;
#         enableOffloadCmd = true;
#       };
#       intelBusId = "PCI:0:2:0";
#       nvidiaBusId = "PCI:1:0:0";
#     };

  # NVIDIA Make sure opengl is enabled
  hardware.opengl = {
    enable = true;
    driSupport = true;
    driSupport32Bit = true;
  };
  # NVIDIA Tell Xorg to use the nvidia driver (also valid for Wayland)
  services.xserver.videoDrivers = [ "nvidia" ];
  #boot.initrd.kernelModules = [ "nvidia" ];
  #boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ];
  hardware.nvidia = {
    # NVIDIA Modesetting is needed for most wayland compositors
    modesetting.enable = true;
    # NVIDIA Use the open source version of the kernel module. Only available for driver 515.43.04+
    open = false;
    # NVIDIA Enable the nvidia settings menu
    nvidiaSettings = true;
    powerManagement.enable = true;
    # NVIDIA Optionally, you may need to select the apporpriate driver version for your specific GPU
    package = config.boot.kernelPackages.nvidiaPackages.stable;
  };

  # Bootloader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  # Setup keyfile
  boot.initrd.secrets = {
    "/crypto_keyfile.bin" = null;
  };

  # Enable swap on luks. SPECIFIC TO MAIN DESKTOP
  boot.initrd.luks.devices."luks-xxxxxxxxxxxxxxxx".device = "/dev/disk/by-uuid/xxxxxxxxxxxxxxxx";
  boot.initrd.luks.devices."luks-xxxxxxxxxxxxxxxxxxx".keyFile = "/crypto_keyfile.bin";

  networking.hostName = "nixos"; # Define your hostname.
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.

  # Configure network proxy if necessary
  # networking.proxy.default = "http://user:password@proxy:port/";
  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

  # Enable networking
  networking.networkmanager.enable = true;

  # Set your time zone.
  time.timeZone = "Europe/Bucharest";

  # Select internationalisation properties.
  i18n.defaultLocale = "en_US.UTF-8";

  i18n.extraLocaleSettings = {
    LC_ADDRESS = "ro_RO.UTF-8";
    LC_IDENTIFICATION = "ro_RO.UTF-8";
    LC_MEASUREMENT = "ro_RO.UTF-8";
    LC_MONETARY = "ro_RO.UTF-8";
    LC_NAME = "ro_RO.UTF-8";
    LC_NUMERIC = "ro_RO.UTF-8";
    LC_PAPER = "ro_RO.UTF-8";
    LC_TELEPHONE = "ro_RO.UTF-8";
    LC_TIME = "ro_RO.UTF-8";
  };

  # Enable the X11 windowing system.
  services.xserver.enable = true;

  # Enable the KDE Plasma Desktop Environment.
  services.xserver.displayManager.sddm.enable = true;
  services.xserver.desktopManager.plasma5.enable = true;

  # Configure keymap in X11
  services.xserver = {
    layout = "us";
    xkbVariant = "";
  };

  # Enable CUPS to print documents.
  services.printing.enable = true;

  # Enable sound with pipewire.
  sound.enable = true;
  hardware.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    # If you want to use JACK applications, uncomment this
    #jack.enable = true;

    # use the example session manager (no others are packaged yet so this is enabled by default,
    # no need to redefine it in your config for now)
    #media-session.enable = true;
  };

  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.nix = {
    isNormalUser = true;
    description = "nix";
    extraGroups = [ "networkmanager" "wheel" "adbusers" ];
    packages = with pkgs; [
      #firefox
      kate
      #thunderbird
    ];
  };

  # Autostart scripts for user
  systemd.services.i2p = {
    description = "I2P service.";
    after = ["network.target"];
    serviceConfig = {
      Type = "simple";
    };
    serviceConfig = {
      User = "nix";
    };
    script = "/run/current-system/sw/bin/i2prouter-plain";
    enable = true; # Start automatically
    wantedBy = [ "multi-user.target" ];
  };

  systemd.services.ipfs = {
    description = "IPFS service.";
    after = ["network.target"];
    unitConfig = {
      Type = "simple";
    };
    serviceConfig = {
      User = "nix";
    };
    script = "/run/current-system/sw/bin/ipfs daemon";
    enable = true; # Start automatically
    wantedBy = [ "multi-user.target" ];
  };

  # Allow unfree packages
  nixpkgs.config.allowUnfree = true;
  hardware.xone.enable = true; # For Xone xbox controller support



  environment.plasma5.excludePackages = with pkgs.libsForQt5; [
    elisa
    okular
    plasma-browser-integration
    print-manager
  ];

  # Installing unstable packages, as in up to date ones.
  # This lets you install packages like "unstable.bitwarden" instead of "pkgs.bitwarden"
  nixpkgs.config = {
  packageOverrides = pkgs: {
    unstable = import (builtins.fetchTarball https://github.com/nixos/nixpkgs/tarball/nixos-unstable) {
      config = config.nixpkgs.config;
      };
    };
  };

  # List packages installed in system profile. To search, run:
  # $ nix search wget
  environment.systemPackages = with pkgs; [
    pkgs.mullvad-vpn

    # Browser
    pkgs.librewolf 
    pkgs.ungoogled-chromium
    pkgs.mullvad-browser
    unstable.firefox
    pkgs.tor-browser-bundle-bin

    # Social
    unstable.ferdium
    pkgs.signal-desktop
    pkgs.element-desktop
    pkgs.teams-for-linux # Fucking Microsoft
    pkgs.gajim #XMPP

    # Remote Connect Applications
    unstable.rustdesk
    pkgs.realvnc-vnc-viewer
    pkgs.virt-viewer # SPICE client for Proxmox
    pkgs.remmina

    # Applications
    unstable.bitwarden
    pkgs.nedit # Text editor for LARGE text files.
    unstable.freetube
    pkgs.onlyoffice-bin
    unstable.libsForQt5.kalk # KDE Calculator
    unstable.libsForQt5.ksystemlog # KDE System logs (Same as journalctl -f just in a GUI)
    pkgs.glogg # Other System logs reader
    unstable.libsForQt5.kolourpaint # KDE Paint
    pkgs.okteta # KDE Hex editor
    pkgs.spotify
    pkgs.vlc
    pkgs.jetbrains.pycharm-community
    pkgs.gpa # PGP or GPG key editor/user
    pkgs.jellyfin-media-player
    pkgs.flameshot
    pkgs.gnome-decoder # QR generator and scanner
    pkgs.onionshare-gui
    pkgs.qdirstat
    pkgs.persepolis
    pkgs.sqlitebrowser
    unstable.fluent-reader # RSS feed reader
    unstable.localsend
    unstable.filezilla

    # Media stuff:
    pkgs.handbrake
    pkgs.krita # Photoshop alternative... Ish...
    unstable.digikam # Also installs showfoto
    pkgs.shotwell
    unstable.obs-studio
    pkgs.simplescreenrecorder
    unstable.vokoscreen-ng


    #Game stuff
    pkgs.cataclysm-dda
    pkgs.bottles
    unstable.heroic
    unstable.steam
    pkgs.protonup-qt
    unstable.scanmem # game conqueror
    pkgs.prismlauncher # Minecraft

    # VM stuff
    unstable.distrobox
    pkgs.virt-manager
    pkgs.gnome.gnome-boxes
    pkgs.android-studio

    # System stuff
    (pkgs.python3.withPackages(ps: with ps; [ pip requests pynput pyautogui pycryptodome pysocks ]))
    pkgs.cifs-utils # SMB share requirement
    pkgs.xorg.xhost # Needed for distrobox to work. xhost to give access to container.
    unstable.podman-compose
    unstable.podman
    pkgs.pciutils
    pkgs.lm_sensors
    linuxKernel.packages.linux_zen.xone # Xbox controller dongle support
    pkgs.wget
    pkgs.git
    pkgs.p7zip
    pkgs.jre_minimal # Java
    pkgs.jdk # Java
    unstable.i2p # P2P Internet protocol.
    unstable.kubo # Go-based implementation of IPFS
    # unstable.lokinet # Oxen lokinet protocol. Disabled since doesn't work and you don't use it.
    pkgs.appimage-run # To run appimages
    unstable.gvfs # Needed for apps in Distrobox

  ];


  #Samba share mount
  services.gvfs.enable = true;
  fileSystems."/mnt/xxxxxxx" = {
    device = "//192.168.0.xxx/hdd";
    fsType = "cifs";
    options = let
     # This line prevents hanging on network split
      automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout-60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=15s,uid=1000,gid=100";
    in ["${automount_opts},username=xxxxxxxx,password=xxxxxxxxxx"];
  };

  # Shell aliases.
  environment.shellAliases = {
    py = "python3";
  };

  # Opening steam ports
  programs.steam = {
    enable = true;
    remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
    dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
  };

  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  programs.adb.enable = true;
  programs.mtr.enable = true;
  programs.gnupg.agent = {
    enable = true;
  };

  # List services that you want to enable:
  services.flatpak.enable = true;
  services.mullvad-vpn.enable = true;

  # Open ports in the firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];
  # Or disable the firewall altogether.
  # networking.firewall.enable = false;

  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It‘s perfectly fine and recommended to leave
  # this value at the release version of the first install of this system.
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "23.05"; # Did you read the comment?

  # Variable for Gnome-Boxes / Virt-manager to work
  virtualisation.libvirtd.enable = true;
  programs.dconf.enable = true;

  # Needed for podman to work, so that distrobox works.
  virtualisation = {
    podman = {
      enable = true;

      # Create a 'docker' alias for podman, to use it as a drop in replacement
      dockerCompat = true;

      # Required for containers under podman-compose to be able to talk to each other
      defaultNetwork.settings.dns_enabled = true;
    };
  };

  # Commands that run on system startup.
  # xhost line is for distrobox to have permission to the display.
  # flatpak to add repo if it doesn't exist.
  environment.shellInit = ''
      [ -n "$DISPLAY" ] && xhost +si:localuser:$USER || true
      flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
    '';

  # https://nixos.wiki/wiki/Environment_variables
  # Setting variables
  #environment.sessionVariables = rec {
    #QT_PLUGIN_PATH = ""; # distrobox fix: Could not load the Qt platform plugin "xcb" in "" even though it was found. Didn't work so not implementing.
    #XDG_CACHE_HOME  = "$HOME/.cache";
    #XDG_CONFIG_HOME = "$HOME/.config";
    #XDG_DATA_HOME   = "$HOME/.local/share";
    #XDG_STATE_HOME  = "$HOME/.local/state";

    # Not officially in the specification
    #XDG_BIN_HOME    = "$HOME/.local/bin";
    #PATH = [
    #  "${XDG_BIN_HOME}"
    #];
  #};

  # TEMP fix to not being able to update due to insecure packages.
  nixpkgs.config.permittedInsecurePackages = [
                #"electron-25.9.0"

              ];


  # Swappiness to reduce swapfile usage.
  boot.kernel.sysctl = { "vm.swappiness" = 10;};

}

Thank you in advance!

Best case scenario is being able to add it to configuration.nix so it continues to be a 1 file solution.

I would not recommend adding dependencies for individual projects to your configuration.nix. At worst, it will not even work.

You can read up on nix shells e.g. in this tutorial on nix.dev.

Wait, so it just won’t work anymore?
So shell.nix is essentially a file that is run if I run “nix-shell” in a terminal while being in the same directory as the file?

I either just use Python straight from the terminal or load up Pycharm and work from there. So I can’t do either of those anymore because of this error?

So now to be able to use Python I have to open a terminal, cd to where I’ve got the shell.nix file, run “nix-shell -p jetbrains.pycharm-community” and that’s the only way to do it now?
Or just “nix-shell” and then “python3 xxx” ?

Well, virtualenv might still work for you, and in fact I use venv rather than Nix for Python depedency management in some projects. But anything to do with system libraries, such as libstdc++ is best managed via a nix shell. My intention was to point out that configuration.nix is not the solution.

That said, you haven’t provided much info to debug the issue. I would suggest you to dig into where pandas is trying to load libstdc++.so.6 from, and why it claims the file was not found. Maybe whatever C/C++ library pandas builds references a version of libstdc++ that does not exist anymore in your current generation of NixOS. That would not be surprising, as virtualenv would not automatically be aware of what is happening in the Nix store.

Running your application under strace and looking for something like a failed dlopen call might help as it seems like it is loading the library dynamically at runtime.

You can also try a minimized example of the shell.nix you posted above:

{ pkgs ? import <nixpkgs> {}}:
pkgs.mkShell {
  LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib/:/run/opengl-driver/lib/"
}

To see if it works as a quick hacky fix.

So now to be able to use Python I have to open a terminal, cd to where I’ve got the shell.nix file, run “nix-shell -p jetbrains.pycharm-community” and that’s the only way to do it now?
Or just “nix-shell” and then “python3 xxx” ?

Yeah, that’s pretty much the way if your application expects to be built or executed in an environment where something is provided by a nix-shell. Although you might be able to modify the “run configuration” or whatever it is called in PyCharm so it automatically enters a nix shell before running your application.

For the record, this might help a bit:

Thanks for the answers guys. Honestly I think this is too much for me.
I had assumed when I first installed NixOS that I could spend a few days setting up configuration.nix and from there it would be functional, and I could take that configuration.nix to any PC and it’d work.
Despite that being technically the idea behind NixOS, it clearly doesn’t work that way.

There’s a large amount of applications that doesn’t work for me at all due to that xcb error that’s also mentioned in the shell.nix example, however I have no idea how to implement this.

The link sent by @chrism shows that I need to install something called nix-ld and configure that, and then setup a shell.nix file?

In any case I tried this solution:

  • Create file ~/Desktop/Python/shell.nix
Fill shell.nix with
{ pkgs ? (import <nixpkgs> {}).pkgs }:
with pkgs;
mkShell {
  buildInputs = [
    python3Packages.virtualenv # run virtualenv .
    python3Packages.pyqt5 # avoid installing via pip
    python3Packages.pyusb # fixes the pyusb 'No backend available' when installed directly via pip
  ];
  shellHook = ''
    # fixes libstdc++ issues and libgl.so issues
    LD_LIBRARY_PATH=${stdenv.cc.cc.lib}/lib/:/run/opengl-driver/lib/
    # fixes xcb issues :
    QT_PLUGIN_PATH=${qt5.qtbase}/${qt5.qtbase.qtPluginPrefix}
  '';
}
  • $ cd ~/Desktop/Python
  • $ nix-shell
  • $ pycharm-community
  • Various warnings in terminal, one of which: ERR: Display.cpp:1014 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
Full log
[nix-shell:~/Desktop/Python]$ pycharm-community
CompileCommand: exclude com/intellij/openapi/vfs/impl/FilePartNodeRoot.trieDescend bool exclude = true
2023-12-20 12:30:03,917 [   1392]   WARN - #c.i.c.ComponentStoreImpl - Duplicated scheme Light - old: Light, new Light
2023-12-20 12:30:04,052 [   1527]   WARN - #c.i.e.t.TargetBasedSdks - SDK target configuration data is absent
2023-12-20 12:30:04,069 [   1544]   WARN - #c.i.e.t.TargetBasedSdks - SDK target configuration data is absent
2023-12-20 12:30:04,075 [   1550]   WARN - #c.i.e.t.TargetBasedSdks - SDK target configuration data is absent
2023-12-20 12:30:04,084 [   1559]   WARN - #c.i.e.t.TargetBasedSdks - SDK target configuration data is absent
2023-12-20 12:30:04,309 [   1784]   WARN - #c.i.o.w.i.c.h.t.MainMenuButton - rootPane is not set, MainMenu button listeners are not installed
Info  | RdCoroutineScope          | 66:DefaultDispatcher-worker-50 | RdCoroutineHost overridden 
ERR: Display.cpp:1014 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
ERR: Display.cpp:1014 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
ERR: Display.cpp:1014 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
ERR: Display.cpp:1014 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
ERR: Display.cpp:1014 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
ERR: Display.cpp:1014 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
ERR: Display.cpp:1014 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
ERR: Display.cpp:1014 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
2023-12-20 12:30:11,151 [   8626]   WARN - #c.i.u.x.Binding - no accessors for com.intellij.openapi.projectRoots.Sdk
2023-12-20 12:30:11,913 [   9388]   WARN - #c.j.p.s.s.PySkeletonRefresher - Some skeletons failed to generate
2023-12-20 12:30:11,913 [   9388]   WARN - #c.j.p.s.s.PySkeletonRefresher - dbus.mainloop.pyqt5
2023-12-20 12:30:11,913 [   9388]   WARN - #c.j.p.s.s.PySkeletonRefresher - numpy.core._umath_tests
2023-12-20 12:30:11,913 [   9388]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.algos
2023-12-20 12:30:11,913 [   9388]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.arrays
2023-12-20 12:30:11,913 [   9388]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.byteswap
2023-12-20 12:30:11,913 [   9388]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.groupby
2023-12-20 12:30:11,913 [   9388]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.hashing
2023-12-20 12:30:11,913 [   9388]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.hashtable
2023-12-20 12:30:11,913 [   9388]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.index
2023-12-20 12:30:11,913 [   9388]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.indexing
2023-12-20 12:30:11,913 [   9388]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.internals
2023-12-20 12:30:11,913 [   9388]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.interval
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.join
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.json
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.lib
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.missing
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.ops
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.ops_dispatch
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.pandas_datetime
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.pandas_parser
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.parsers
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.properties
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.reshape
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.sas
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.sparse
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.testing
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.tslib
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.tslibs.base
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.tslibs.ccalendar
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.tslibs.conversion
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.tslibs.dtypes
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.tslibs.fields
2023-12-20 12:30:11,914 [   9389]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.tslibs.nattype
2023-12-20 12:30:11,915 [   9390]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.tslibs.np_datetime
2023-12-20 12:30:11,915 [   9390]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.tslibs.offsets
2023-12-20 12:30:11,915 [   9390]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.tslibs.parsing
2023-12-20 12:30:11,915 [   9390]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.tslibs.period
2023-12-20 12:30:11,915 [   9390]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.tslibs.strptime
2023-12-20 12:30:11,915 [   9390]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.tslibs.timedeltas
2023-12-20 12:30:11,915 [   9390]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.tslibs.timestamps
2023-12-20 12:30:11,915 [   9390]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.tslibs.timezones
2023-12-20 12:30:11,915 [   9390]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.tslibs.tzconversion
2023-12-20 12:30:11,915 [   9390]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.tslibs.vectorized
2023-12-20 12:30:11,915 [   9390]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.window.aggregations
2023-12-20 12:30:11,915 [   9390]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.window.indexers
2023-12-20 12:30:11,915 [   9390]   WARN - #c.j.p.s.s.PySkeletonRefresher - pandas._libs.writers
2023-12-20 12:30:23,552 [  21027]   WARN - #c.i.i.s.download - Shared indexes download was cancelled. Indexing has completed faster
2023-12-20 12:30:38,217 [  35692]   WARN - #c.i.u.x.Binding - no accessors for java.time.LocalTime
  • Try to run code in pycharm. Get same error ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory
  • exit pycharm. Try to run directly from my own venv.
  • $ source ~/Desktop/Python/venv_1/bin/activate
  • Get same error.
Full log
[nix-shell:~/Desktop/Python]$ py ./v21/v21.py 
Traceback (most recent call last):
  File "/home/nix/Desktop/Python/./v21/v21.py", line 19, in <module>
    import pandas as pd
  File "/home/nix/Desktop/Python/venv_1/lib/python3.11/site-packages/pandas/__init__.py", line 46, in <module>
    from pandas.core.api import (
  File "/home/nix/Desktop/Python/venv_1/lib/python3.11/site-packages/pandas/core/api.py", line 47, in <module>
    from pandas.core.groupby import (
  File "/home/nix/Desktop/Python/venv_1/lib/python3.11/site-packages/pandas/core/groupby/__init__.py", line 1, in <module>
    from pandas.core.groupby.generic import (
  File "/home/nix/Desktop/Python/venv_1/lib/python3.11/site-packages/pandas/core/groupby/generic.py", line 67, in <module>
    from pandas.core.frame import DataFrame
  File "/home/nix/Desktop/Python/venv_1/lib/python3.11/site-packages/pandas/core/frame.py", line 142, in <module>
    from pandas.core.generic import (
  File "/home/nix/Desktop/Python/venv_1/lib/python3.11/site-packages/pandas/core/generic.py", line 187, in <module>
    from pandas.core.window import (
  File "/home/nix/Desktop/Python/venv_1/lib/python3.11/site-packages/pandas/core/window/__init__.py", line 1, in <module>
    from pandas.core.window.ewm import (
  File "/home/nix/Desktop/Python/venv_1/lib/python3.11/site-packages/pandas/core/window/ewm.py", line 11, in <module>
    import pandas._libs.window.aggregations as window_aggregations
ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory
(venv_1) 

Biggest issue I have is really that pandas doesn’t work within a venv. I don’t know why, I thought venvs include the underlying Python’s packages… I am creating the venvs with the tag --system-site-packages
But within a venv I cannot import pandas, so I have to install it again, which causes these errors.
I tried recreating everything from scratch, but just doesn’t work.

I appreciate all the help, but I think at this point this is beyond me and I feel like asking for a step by step readable by a 5 year old is asking too much. I give up.

Thanks for the help, I really appreciate it, I might come back to this at a later time if I ever decide to figure this out. For now I’ll stick to just not using venvs, installing all packages via configuration.nix and using terrible work arounds to packages not in nixpkgs.