-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use withPackages
#12
Comments
If I copy that to my browser it works. Do you have problems with networking? |
@asymmetric could you provide exact steps and files how to reproduce it? |
Same issue as #14 |
Should be fixed on main, can you try? |
I'm not currently using this anymore, so I won't be able to investigate further, but running
{
inputs.nixpkgs.url = "github:nixos/nixpkgs";
inputs.nixpkgs-python.url = "github:cachix/nixpkgs-python";
outputs = inputs:
let
system = "x86_64-linux";
pkgs = inputs.nixpkgs.legacyPackages.${system};
in
{
devShells.${system}.default = pkgs.mkShell {
packages = (inputs.nixpkgs-python.packages.${system}."3.9.2".withPackages (ps: with ps; [ requests ]));
};
};
}
|
I was getting hit by the same error, then realized I was using a flake based on a template that still was on nixpkgs nixos-23.05. Once I updated to 23.11, this seems to be working. Sample config: Edit: Not really related to this issue, but just in case anyone tries the below code: My example actually must specify python 3.11.6 or below for the time being (which is the version in nixpkgs 23.11), because of some annoying issues with a bug in pytest-mock (which is a transitive dependency of practically everything). See:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
nixpkgs-python.url = "github:cachix/nixpkgs-python";
systems.url = "github:nix-systems/default";
devenv.url = "github:cachix/devenv";
};
outputs = { self, nixpkgs, devenv, systems, nixpkgs-python, ... }@inputs:
let forEachSystem = nixpkgs.lib.genAttrs (import systems);
in {
devShells = forEachSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [{
languages.python.enable = true;
languages.python.version = "3.11.6";
languages.python.venv.enable = true;
packages = with pkgs; [
postgresql
playwright
(nixpkgs-python.packages.${system}."3.11.6".withPackages (ps:
with ps; [
requests
pyyaml
]))
];
enterShell = ''pip install -r requirements.txt -e .'';
}];
};
});
};
} |
I have the following in my
flake.nix
:which fails to build:
If I try adding
matplotlib
instead, the error is different:The text was updated successfully, but these errors were encountered: