You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That is, works as expected with pkgs.mkShell but doesn't work with devshell.mkShell. In fact I have to use (hiPrio python3) instead of python3 because of some collision error, but that seems to be unrelated.
I'm a beginner in the nix world so I don't really understand the difference between using python3Packages.numpy and python3.withPackages(p: [ p.numpy ]).
Looking at the output of sys.path in the 2 shell.nix above, the difference is clear: the second one has only
I had actually cloned NixOS/nixpkgs and searched for some python package named *gdal* in pkgs/development/python-modules. But now I understand that it is defined only in pkgs/top-level/python-packages.nix (using the toPythonModule function).
But I would like to suggest that devshell should somehow support buildInputs, which would probably solve these kind of discrepancies between pkgs.mkShell and devshell.mkShell. I searched the past issues and it looks like it happened before:
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
I want to use the
gdal_calc.py
utility, which is part of thegdal
nixpkg.gdal_calc.py
imports the numpy python package: https://github.com/OSGeo/gdal/blob/master/swig/python/gdal-utils/osgeo_utils/gdal_calc.pyTo Reproduce
This plain old
shell.nix
works as expected withnix-shell
However this other
shell.nix
, which uses the same packages via devshell, does not work:When executing
gdal_calc.py
I get the error "ModuleNotFoundError: No module named 'numpy'"Expected behavior
I expected that the 'numpy' python module was available.
System information
Additional context
The problem remains when using the
packages
attribute asThat is, works as expected with
pkgs.mkShell
but doesn't work withdevshell.mkShell
. In fact I have to use(hiPrio python3)
instead ofpython3
because of some collision error, but that seems to be unrelated.I'm a beginner in the nix world so I don't really understand the difference between using
python3Packages.numpy
andpython3.withPackages(p: [ p.numpy ])
.Looking at the output of
sys.path
in the 2shell.nix
above, the difference is clear: the second one has onlywhile the first one has those same 4 paths and also these extra 2 paths:
So I guess my question is: what should I do to have the same
sys.path
in devshell?Thanks for your time and for this great tool!
The text was updated successfully, but these errors were encountered: