I can’t create a devShell with Jupyter and Matplotlib simultaneously. Somehow, this happens when I do:
➜ nix develop --command python -c 'import matplotlib.pyplot as plt; plt.plot([1,2],[3,4]); plt.show()'
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.
[1] 1157020 IOT instruction (core dumped) nix develop --command python -c
Here is the flake.nix
I am using (minimum not working example)
{
inputs = {
flake-utils = {
url = "github:numtide/flake-utils";
};
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
{
devShell = pkgs.mkShell {
buildInputs = [
(nixpkgs.legacyPackages.${system}.python39.withPackages(ps: [
ps.jupyter
ps.matplotlib
]))
];
};
});
}
I have come across this page, which quotes the exact error, but I do not understand what it means or how to apply it here.