Python qt.qpa.plugin: Could not find ... "xcb"

I have a python plotting script that used to work (I think) in a nix-sell environment. Today, the script dies with the following message:


$ nix-shell --pure develop.nix

[nix-shell:~/projects/nix_test]$ python --show --velocity
qt.qpa.plugin: Could not find the Qt platform plugin “xcb” in “”
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Aborted (core dumped)


I think this is my first post to this site. Is this post appropriate? I could push my code to github or somewhere else. There are only two relevant files: develop.nix which defines the environment and which makes simple plots. They are part of a project that documents my progress learning about Nix and my effort to use it to support reproducible research. The whole project has 10 other files that are not relevant to my problem today.

Thanks for any help/pointers,


I found a solution in another thread.. The solution is to add the following line to the definition of my development environment:



Was using this solution until Qt version 5.15.9. Now the subfolder platforms should be added to the path as in