This is the flake.nix I use.
{ description = "";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
python = pkgs.python312;
pyecharts = with pkgs.python3Packages;
buildPythonPackage rec {
pname = "pyecharts";
version = "2.0.6";
src = pkgs.fetchPypi {
inherit pname version;
sha256 = "4d7f8dcbee1525a6eeecab589efcdbe939feee4c46930d90b2734bff04077ecc";
};
};
python_packages = python.withPackages(ps: with ps;[
ipython
pyecharts
streamlit
]);
myDevTools = [
python_packages
];
in {
devShells.default = pkgs.mkShell {
buildInputs = myDevTools;
};
}); }
After running
nix develop
, I get this error
error: builder for
‘/nix/store/5cmw2nmna4fwc3jsqqmi6rspkvvsbmkq-python3.12-pyecharts-2.0.6.drv’
failed with exit code 1;
last 10 log lines:
> ws.require(requires)
> File “/nix/store/x03rhgdr578lszbh5kgxrngv9xm77gxb-python3.12-setuptools-70.0.0/lib/python3.12/site-packages/pkg_resources/init.py”,
line 926, in require
> needed = self.resolve(parse_requirements(requirements))
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File “/nix/store/x03rhgdr578lszbh5kgxrngv9xm77gxb-python3.12-setuptools-70.0.0/lib/python3.12/site-packages/pkg_resources/init.py”,
line 787, in resolve
> dist = self._resolve_dist(
> ^^^^^^^^^^^^^^^^^^^
> File “/nix/store/x03rhgdr578lszbh5kgxrngv9xm77gxb-python3.12-setuptools-70.0.0/lib/python3.12/site-packages/pkg_resources/init.py”,
line 828, in _resolve_dist
> raise DistributionNotFound(req, requirers)
> pkg_resources.DistributionNotFound: The ‘simplejson’ distribution was not found and is required by the application
For full logs, run ‘nix log /nix/store/5cmw2nmna4fwc3jsqqmi6rspkvvsbmkq-python3.12-pyecharts-2.0.6.drv’.
error: 1 dependencies of derivation
‘/nix/store/dnc88j3352c0x2692w8mikm9hfz7qn26-python3-3.12.4-env.drv’
failed to build error: 1 dependencies of derivation
‘/nix/store/v2az01iry2pdxsqkkikwrycv5zi4wmhr-nix-shell-env.drv’ failed
to build
As recommended, I run
nix log /nix/store/5cmw2nmna4fwc3jsqqmi6rspkvvsbmkq-python3.12-pyecharts-2.0.6.drv
@nix { “action”: “setPhase”, “phase”: “setuptoolsCheckPhase” } Running
phase: setuptoolsCheckPhase Executing setuptoolsCheckPhase Traceback
(most recent call last): File
“/build/pyecharts-2.0.6/nix_run_setup”, line 8, in
exec(compile(getattr(tokenize, ‘open’, open)(file).read().replace(‘rn’, ‘n’), file, ‘exec’))
File “setup.py”, line 72, in
setup( File “/nix/store/x03rhgdr578lszbh5kgxrngv9xm77gxb-python3.12-setuptools-70.0.0/lib/python3.12/site-packages/setuptools/init.py”,
line 103, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/nix/store/x03rhgdr578lszbh5kgxrngv9xm77gxb-python3.12-setuptools-70.0.0/lib/python3.12/site-packages/setuptools/_distutils/core.py”,
line 171, in setup
ok = dist.parse_command_line()
^^^^^^^^^^^^^^^^^^^^^^^^^ File “/nix/store/x03rhgdr578lszbh5kgxrngv9xm77gxb-python3.12-setuptools-70.0.0/lib/python3.12/site-packages/setuptools/_distutils/dist.py”,
line 476, in parse_command_line
args = self._parse_command_opts(parser, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/nix/store/x03rhgdr578lszbh5kgxrngv9xm77gxb-python3.12-setuptools-70.0.0/lib/python3.12/site-packages/setuptools/dist.py”,
line 870, in _parse_command_opts
nargs = _Distribution._parse_command_opts(self, parser, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File
“/nix/store/x03rhgdr578lszbh5kgxrngv9xm77gxb-python3.12-setuptools-70.0.0/lib/python3.12/site-packages/setuptools/_distutils/dist.py”,
line 535, in _parse_command_opts
cmd_class = self.get_command_class(command)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/nix/store/x03rhgdr578lszbh5kgxrngv9xm77gxb-python3.12-setuptools-70.0.0/lib/python3.12/site-packages/setuptools/dist.py”,
line 715, in get_command_class
self.cmdclass[command] = cmdclass = ep.load()
^^^^^^^^^ File “/nix/store/z7xxy35k7620hs6fn6la5fg2lgklv72l-python3-3.12.4/lib/python3.12/importlib/metadata/init.py”,
line 205, in load
module = import_module(match.group(‘module’))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/nix/store/z7xxy35k7620hs6fn6la5fg2lgklv72l-python3-3.12.4/lib/python3.12/importlib/init.py”,
line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “”, line 1387, in _gcd_import File
“”, line 1360, in _find_and_load File
“”, line 1331, in _find_and_load_unlocked
File “”, line 935, in _load_unlocked
File “”, line 995, in
exec_module File “”, line 488, in
_call_with_frames_removed File “/nix/store/x03rhgdr578lszbh5kgxrngv9xm77gxb-python3.12-setuptools-70.0.0/lib/python3.12/site-packages/setuptools/command/test.py”,
line 11, in
from pkg_resources import ( File “/nix/store/x03rhgdr578lszbh5kgxrngv9xm77gxb-python3.12-setuptools-70.0.0/lib/python3.12/site-packages/pkg_resources/init.py”,
line 3282, in
@_call_aside
^^^^^^^^^^^ File “/nix/store/x03rhgdr578lszbh5kgxrngv9xm77gxb-python3.12-setuptools-70.0.0/lib/python3.12/site-packages/pkg_resources/init.py”,
line 3266, in _call_aside
f(*args, **kwargs) File “/nix/store/x03rhgdr578lszbh5kgxrngv9xm77gxb-python3.12-setuptools-70.0.0/lib/python3.12/site-packages/pkg_resources/init.py”,
line 3295, in _initialize_master_working_set
working_set = _declare_state(‘object’, ‘working_set’, WorkingSet._build_master())
^^^^^^^^^^^^^^^^^^^^^^^^^^ File
“/nix/store/x03rhgdr578lszbh5kgxrngv9xm77gxb-python3.12-setuptools-70.0.0/lib/python3.12/site-packages/pkg_resources/init.py”,
line 589, in _build_master
ws.require(requires) File “/nix/store/x03rhgdr578lszbh5kgxrngv9xm77gxb-python3.12-setuptools-70.0.0/lib/python3.12/site-packages/pkg_resources/init.py”,
line 926, in require
needed = self.resolve(parse_requirements(requirements))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/nix/store/x03rhgdr578lszbh5kgxrngv9xm77gxb-python3.12-setuptools-70.0.0/lib/python3.12/site-packages/pkg_resources/init.py”,
line 787, in resolve
dist = self._resolve_dist(
^^^^^^^^^^^^^^^^^^^ File “/nix/store/x03rhgdr578lszbh5kgxrngv9xm77gxb-python3.12-setuptools-70.0.0/lib/python3.12/site-packages/pkg_resources/init.py”,
line 828, in _resolve_dist
raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The ‘simplejson’ distribution was
not found and is required by the application
ButI still don’t understand the cause of the problem
In the first eerror message, It was written simplejson not found. I ve added it in propagatedBuildInputs. I ve added jinja2 amd prettytable too because these errors occurs after the first problem was fixed
{ description = "";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
python = pkgs.python312;
pyecharts = with pkgs.python3Packages;
buildPythonPackage rec {
pname = "pyecharts";
version = "2.0.6";
src = pkgs.fetchPypi {
inherit pname version;
sha256 = "4d7f8dcbee1525a6eeecab589efcdbe939feee4c46930d90b2734bff04077ecc";
};
propagatedBuildInputs = [ simplejson prettytable jinja2 ];
};
python_packages = python.withPackages(ps: with ps;[
ipython
pyecharts
streamlit
]);
myDevTools = [
python_packages
];
in {
devShells.default = pkgs.mkShell {
buildInputs = myDevTools;
};
}); }