# Installation of pyside6

**URL:** https://discourse.nixos.org/t/installation-of-pyside6/14385
**Category:** Help
**Created:** [August 3, 2021, 5:46pm UTC](https://discourse.nixos.org/t/installation-of-pyside6/14385 "2021-08-03T17:46:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rockn](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/r/7bcc69/32.png) [@rockn](https://discourse.nixos.org/u/rockn)
#### Post date: [August 3, 2021, 5:46pm UTC](https://discourse.nixos.org/t/installation-of-pyside6/14385/1 "2021-08-03T17:46:55Z")

</div>

Hi there, new to nix and I was trying to install pyside6 through virtualenv and got this error.

```auto
$ python test_pyside.py                                                                                                       
Traceback (most recent call last):
  File "test_pyside.py", line 2, in <module>
    from PySide6.QtCore import Qt
ImportError: libglib-2.0.so.0: cannot open shared object file: No such file or directory

```

Then I tried to find the runtime libraries needed for it using ldd.

```auto
 $ ldd venv/lib/python3.8/site-packages/PySide6/libpyside6.abi3.so.6.1                                                       
        linux-vdso.so.1 (0x000068752139c000)
        libshiboken6.abi3.so.6.1 => not found
        libQt6Qml.so.6 => /home/quark/4-X PHOTON/0_DEV/1_REPOS/pygui/venv/lib/python3.8/site-packages/PySide6/Qt/lib/libQt6Qml.so.6 (0x0000687520c1f000)
        libQt6Network.so.6 => /home/quark/4-X PHOTON/0_DEV/1_REPOS/pygui/venv/lib/python3.8/site-packages/PySide6/Qt/lib/libQt6Network.so.6 (0x0000687520a23000)
        libQt6Core.so.6 => /home/quark/4-X PHOTON/0_DEV/1_REPOS/pygui/venv/lib/python3.8/site-packages/PySide6/Qt/lib/libQt6Core.so.6 (0x0000687520426000)
        libstdc++.so.6 => /nix/store/dzaadhn5y56da24635icafv1nrawxm4n-gcc-10.3.0-lib/lib/libstdc++.so.6 (0x0000687520251000)
        libm.so.6 => /nix/store/gk42f59363p82rg2wv2mfy71jn5w4q4c-glibc-2.32-48/lib/libm.so.6 (0x000068752010c000)
        libgcc_s.so.1 => /nix/store/dzaadhn5y56da24635icafv1nrawxm4n-gcc-10.3.0-lib/lib/libgcc_s.so.1 (0x00006875200f2000)
        libpthread.so.0 => /nix/store/gk42f59363p82rg2wv2mfy71jn5w4q4c-glibc-2.32-48/lib/libpthread.so.0 (0x00006875200d1000)
        libc.so.6 => /nix/store/gk42f59363p82rg2wv2mfy71jn5w4q4c-glibc-2.32-48/lib/libc.so.6 (0x000068751ff10000)
        libdl.so.2 => /nix/store/gk42f59363p82rg2wv2mfy71jn5w4q4c-glibc-2.32-48/lib/libdl.so.2 (0x000068751ff0b000)
        libgssapi_krb5.so.2 => not found
        libz.so.1 => not found
        libicui18n.so.56 => /home/quark/4-X PHOTON/0_DEV/1_REPOS/pygui/venv/lib/python3.8/site-packages/PySide6/Qt/lib/libicui18n.so.56 (0x000068751fa70000)
        libicuuc.so.56 => /home/quark/4-X PHOTON/0_DEV/1_REPOS/pygui/venv/lib/python3.8/site-packages/PySide6/Qt/lib/libicuuc.so.56 (0x000068751f6b8000)
        libicudata.so.56 => /home/quark/4-X PHOTON/0_DEV/1_REPOS/pygui/venv/lib/python3.8/site-packages/PySide6/Qt/lib/libicudata.so.56 (0x000068751dcd5000)
        libglib-2.0.so.0 => not found
        libz.so.1 => not found
        libgthread-2.0.so.0 => not found
        librt.so.1 => /nix/store/gk42f59363p82rg2wv2mfy71jn5w4q4c-glibc-2.32-48/lib/librt.so.1 (0x000068751dcc8000)
        /nix/store/gk42f59363p82rg2wv2mfy71jn5w4q4c-glibc-2.32-48/lib64/ld-linux-x86-64.so.2 (0x000068752139e000)

```

I know some of these library paths can be found and added to the variable to LD\_LIBRARY\_PATH.  
I have also tried using nix-shell but pyside6 wasn’t available in nixpkgs. Is there a way pyside6 can be installed using nix-shell?

---

<div class="post-metadata">

### Author: ![jtojnar](https://discourse.nixos.org/user_avatar/discourse.nixos.org/jtojnar/32/70_2.png) [@jtojnar](https://discourse.nixos.org/u/jtojnar)
#### Post date: [August 28, 2021, 9:29pm UTC](https://discourse.nixos.org/t/installation-of-pyside6/14385/2 "2021-08-28T21:29:34Z")

</div>

You should still be able to create an environment containing the libraries using `nix-shell -p zlib libkrb5 …` (or create a [shell.nix](https://nixos.wiki/wiki/Qt#Development) file and then you can just run `nix-shell` without arguments).

---

<div class="post-metadata">

### Author: ![bittner](https://discourse.nixos.org/user_avatar/discourse.nixos.org/bittner/32/17267_2.png) [@bittner](https://discourse.nixos.org/u/bittner)
#### Post date: [July 12, 2025, 9:03am UTC](https://discourse.nixos.org/t/installation-of-pyside6/14385/3 "2025-07-12T09:03:30Z")

</div>

I use [nix-ld](https://wiki.nixos.org/wiki/Nix-ld) to fix those kinds of issues for me. Note, `glib` is not in its defaults, so you have to add it to the list of covered libraries, explicitly:

```auto
{ options, pkgs, ... }:
{
  programs.nix-ld = {
    enable = true;
    libraries = options.programs.nix-ld.libraries.default ++ (
      with pkgs; [
        glib # libglib-2.0.so.0
      ]
    );
  };
}

```

To make the picture complete, I install both the Python interpreter and Python packages using `uv`, e.g.

```auto
$ uv python install 3.13 --default --preview
$ uv run --with pyside6 python
Installed 4 packages in 90ms
Python 3.13.5 (main, Jun 26 2025, 21:20:04) [Clang 20.1.4] on linux
>>> from PySide6.QtCore import Qt
>>> 

```
