I have setup my Python project using virtualenv using python.poetry package. Not yet moved to nix-shell. the installation of all packages went without any errors. But I am not able to run jupyter notebook.
I was getting some errors related to czmq. I have installed the pacakge globally with environment.systemPackages. After I am getting the following error
I haven’t done systems programming and don’t know much about LD_LIBRARY_PATH. I have checked other posts that told to set the LD_LIBRARYPATH. But that doesn’t work for me.
I’ve just find a way to run Jupyter Notebook managed by Poetry in NixOS.
Create the environment package first with mkPoetryEnv and then send it to buildFHSUserEnv.
Here is what I do:
The two pieces of code are borrowed from other people (one from this forum and and another from the poetry2nix documentation) with a few modifications, as I’m also a newbie here.
BTW, it seems better to categorize this topic as #learn instead of howto.
Your underlying issue is that nixos only exposes the libc libraries, but not the c++ libraries, which is why some .so’s will work fine, but many c++ ones will not.
I also made a video demonstrating nix python package usage with nix-shell here: https://youtu.be/jXd-hkP4xnU?t=1497 . I fast forwarded to roughly the correct spot.
if all of your dependencies are in nixpkgs, you could use python.withPackages, and build a ipykernel which references it. Poetry2nix will probably allow you to do similar things, I just don’t have any experience with it.