我跑步
nix develop
在包含 flake.nix 的目录中,如下所示:
{
description = "Python environment with ollama";
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};
jina-hubble-sdk = with pkgs.python3Packages;
buildPythonPackage rec {
pname = "jina-hubble-sdk";
version = "0.39.0";
src = pkgs.fetchPypi {
inherit pname version;
sha256 = "9021417794a6d3cf3fad8a880cf668a3a986b9d53d5be5fa391aae1767a5b9b0";
};
nativeBuildInputs = [
poetry-core
pkgs.dos2unix # Add dos2unix to convert line endings
];
propagatedBuildInputs = [
pep517
pip
requests
aiohttp
rich
importlib-metadata
filelock
pathspec
docker
pyyaml
python-jose
];
# Convert line endings to Unix-style
# preConfigure = ''
# dos2unix -f /nix/store/v099hqvw5z87423p4hz1vfhzaqa07dii-stdenv-linux/setup
# '';
};
pythonEnv = pkgs:
pkgs.python3.withPackages (ps:
with ps; [
jina-hubble-sdk
]);
in {
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
curl
ollama
(pythonEnv pkgs)
];
};
});
}
我收到以下错误
错误:构建器 '/nix/store/dm6cxw020s7whbfgqj8jivd3dv1pby0i-python3.11-jina-hubble-sdk-0.39.0.drv' 失败,退出代码为 127; 最后 10 行日志: > 使用 setuptoolsCheckPhase > 运行阶段:unpackPhase > 解压源存档 /nix/store/9q6b5l6955sabgvk8ah5xx0sfji25zmn-jina-hubble-sdk-0.39.0.tar.gz > 源根目录是 jina-hubble-sdk-0.39.0 > 将 SOURCE_DATE_EPOCH 设置为文件 jina-hubble-sdk-0.39.0/setup.cfg 的时间戳 1688549032 > 运行阶段:patchPhase > 运行阶段:updateAutotoolsGnuConfigScriptsPhase > 运行阶段:configurePhase > /nix/store/v099hqvw5z87423p4hz1vfhzaqa07dii-stdenv-linux/setup: 行 114:$' ': 找不到命令 > /nix/store/v099hqvw5z87423p4hz1vfhzaqa07dii-stdenv-linux/setup: 行 131: pop_var_context: shell_variables 头不是函数上下文 对于完整日志,请运行“nix-store -l /nix/store/dm6cxw020s7whbfgqj8jivd3dv1pby0i-python3.11-jina-hubble-sdk-0.39.0.drv”。 错误:1 推导的依赖关系 '/nix/store/25gl4f29rr56ci1h5k53wmm7wgfmk2p2-python3-3.11.8-env.drv' 构建失败错误:1 派生依赖项 “/nix/store/pxkgnl5nx66fcdi1rkvz86kbfrvlmhn2-nix-shell-env.drv”失败 建造
错误消息中的重要行:
/nix/store/v099hqvw5z87423p4hz1vfhzaqa07dii-stdenv-linux/setup:第 114 行:$' ':找不到命令>
我认为这个问题与linux和window(参见这个网站)必须换行的不同方式有关。我想调整导致问题的文件:
preConfigure = ''
# dos2unix -f /nix/store/v099hqvw5z87423p4hz1vfhzaqa07dii-stdenv-linux/setup
# '';
但它什么也改变不了。因此我评论了它,但你可以取消注释来自己测试。
为什么注册不起作用?上面写着
出了点问题。