我正在使用JupyterWith框架在Nix OS上定义声明性和可重现的Jupyter环境。基于documentation,我已经创建了shell.nix文件,我在其中定义了所有的python依赖项。它工作得很好:
let
jupyter = import (builtins.fetchGit {
url = https://github.com/tweag/jupyterWith;
rev = "37cd8caefd951eaee65d9142544aa4bd9dfac54f";
}) {};
iPython = jupyter.kernels.iPythonWith {
name = "python";
packages = p: with p; [
pandas
numpy
seaborn
matplotlib
scikitlearn
# prophet
];
};
iHaskell = jupyter.kernels.iHaskellWith {
extraIHaskellFlags = "--codemirror Haskell";
name = "haskell";
packages = p: with p; [ hvega formatting ];
};
jupyterEnvironment =
jupyter.jupyterlabWith {
kernels = [ iPython iHaskell ];
};
in
jupyterEnvironment.env但是,当我将prophet包添加为另一个python依赖项时,问题就出现了。在那之后,当我尝试运行nix-shell时,我得到了以下错误:
jbezdek@kraken:~$ nix-shell ~/shell.nix.jupyter
error: undefined variable 'prophet' at /home/jbezdek/shell.nix.jupyter:15:7
(use '--show-trace' to show detailed location information)请问我哪里做错了,你能帮我吗?
发布于 2021-08-16 06:37:26
据我所知,你没做错什么。prophet的问题更多的是在幕后。可以与Nix一起使用的Python包不是在PyPI上找到的包(通过某种镜像),而是包源本身的Nix派生包。这意味着,对于一个可以与Nix一起使用的包,需要有人为此编写一个合适的派生。
可以在search.nixos.org上搜索并找到标准nixpkgs-unstable和稳定频道上的所有可用包。当您在那里输入prophet时,您将不会在python3Packages包集下找到它,这意味着还没有人努力为它编写一个派生。因此,最好的机会是开始编写您自己的派生(请参阅the manual),或者在GitHub repo上发出包请求。
https://stackoverflow.com/questions/68708683
复制相似问题