poetry2nix
poetry2nix copied to clipboard
Unable to fetch wheel from PyTorch geometric
Describe the issue
When I have a python project with torch_geometric
as a dependency, I get
error: builder for '/nix/store/6j1c9dv9s0h8kd91na3ig0jjkkl2c7x0-pyg_lib-0.4.0+pt22cu118-cp311-cp311-linux_x86_64.whl.drv' failed with exit code 1;
last 23 log lines:
> Reading index https://data.pyg.org/whl/torch-2.2.0+cu118.html/pyg-lib/
> Traceback (most recent call last):
> File "/nix/store/0rzh74dywg10ggl3ds6khsdpc84nbp96-fetch-from-legacy.py", line 82, in <module>
> response = urllib.request.urlopen(req, context=context)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/nix/store/3v2ch16fkl50i85n05h5ckss8pxx6836-python3-3.11.8/lib/python3.11/urllib/request.py", line 216, in urlopen
> return opener.open(url, data, timeout)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/nix/store/3v2ch16fkl50i85n05h5ckss8pxx6836-python3-3.11.8/lib/python3.11/urllib/request.py", line 525, in open
> response = meth(req, response)
> ^^^^^^^^^^^^^^^^^^^
> File "/nix/store/3v2ch16fkl50i85n05h5ckss8pxx6836-python3-3.11.8/lib/python3.11/urllib/request.py", line 634, in http_response
> response = self.parent.error(
> ^^^^^^^^^^^^^^^^^^
> File "/nix/store/3v2ch16fkl50i85n05h5ckss8pxx6836-python3-3.11.8/lib/python3.11/urllib/request.py", line 563, in error
> return self._call_chain(*args)
> ^^^^^^^^^^^^^^^^^^^^^^^
> File "/nix/store/3v2ch16fkl50i85n05h5ckss8pxx6836-python3-3.11.8/lib/python3.11/urllib/request.py", line 496, in _call_chain
> result = func(*args)
> ^^^^^^^^^^^
> File "/nix/store/3v2ch16fkl50i85n05h5ckss8pxx6836-python3-3.11.8/lib/python3.11/urllib/request.py", line 643, in http_error_default
> raise HTTPError(req.full_url, code, msg, hdrs, fp)
> urllib.error.HTTPError: HTTP Error 403: Forbidden
For full logs, run 'nix-store -l /nix/store/6j1c9dv9s0h8kd91na3ig0jjkkl2c7x0-pyg_lib-0.4.0+pt22cu118-cp311-cp311-linux_x86_64.whl.drv'.
error: 1 dependencies of derivation '/nix/store/3pwcgjx91b6282p3v4hczy4ja8zjxi1i-python3.11-pyg-lib-0.4.0+pt22cu118.drv' failed to build
Additional context
default.nix
/shell.nix
/flake.nix
:
{
description = "Reproducible";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ {
self,
nixpkgs,
flake-parts,
poetry2nix,
...
} : flake-parts.lib.mkFlake { inherit inputs; } {
flake = {
};
systems = [
"x86_64-linux"
"x86_64-darwin"
];
perSystem = { system, pkgs, ... }: let
inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; })
defaultPoetryOverrides mkPoetryApplication mkPoetryEnv;
args = {
python = pkgs.python311;
preferWheels = true;
overrides = defaultPoetryOverrides;
};
application = mkPoetryApplication (args // {
projectDir = ./.;
});
in rec {
packages = {
default = application;
};
};
};
}
pyproject.toml
:
[tool.poetry]
name = "reproducible"
version = "0.0.1"
description = "torch and geometric"
authors = ["Leni Aniva <[email protected]>"]
readme = "README.md"
include = []
packages = [{ include = "reproducible" }]
[tool.poetry.scripts]
reproducible = "reproducible.util:main"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.dependencies]
python = "^3.11"
numpy = "^1.26"
#torch = { url = "https://download.pytorch.org/whl/cu118/torch-2.2.1+cu118-cp311-cp311-linux_x86_64.whl" }
torch = { version = "^2.2.0", source = "pytorch-cu118" }
torch-geometric = "^2.5.2"
pyg-lib = { version = "0.4.0", source = "pyg-torch220-cu118" }
torch-cluster = { version = "1.6.3", source = "pyg-torch220-cu118" }
torch-scatter = { version = "2.1.2", source = "pyg-torch220-cu118" }
torch-sparse = { version = "0.6.18", source = "pyg-torch220-cu118" }
torch-spline-conv = { version = "1.2.2", source = "pyg-torch220-cu118" }
[[tool.poetry.source]]
name = "pytorch-cu118"
url = "https://download.pytorch.org/whl/cu118"
priority = "explicit"
[[tool.poetry.source]]
name = "pyg-torch220-cu118"
url = "https://data.pyg.org/whl/torch-2.2.0+cu118.html"
priority = "explicit"