That’s because those are two independent python “instances”. Try it out, swap them around and use command -v python on both. You’ll see that they are in different directories.
When you put a package in the packages of a devshell, nix will put their “bin” directory in your $PATH when you run nix develop. So depending on the order, one python will override the other - you can’t have two different pythons available with the same command.
You’ll probably need to put all the packages in the same python instance. Why do you want to use one from nixpkgs and all the others from mach-nix?
Alternatively you could put python3Packages.rasterio in the devshell’s packages, I think that will add it to $PYTHONPATH and should then just work with your other python env, but I’m not 100% sure.
Thanks for the clarification! I was not aware that they’re independent python instances.
The reason is that I had issues installing rasterio and other dependencies with `mach-nix:
ERROR: Could not find a version that satisfies the requirement pytest>=2.6.0 (from pytest-env) (from versions: none)
> ERROR: No matching distribution found for pytest>=2.6.0
However I found the package on nixpkgs and was able to build it. Your suggestion worked, thanks!
Though I thought this was the default behavior. If that still doesn’t work, make sure you set inputs.mach-nix.inputs.nixpkgs.follows = "nixpkgs", so that mach-nix uses the same version of nixpkgs as you are.