在NixOS中,如何使用Python包SpaCy、pandas和jenksnaturalbreaks安装环境?

2024-06-26 02:19:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我对尼克松很陌生,所以请原谅我的无知。我试图打破任何一种环境,如Python,熊猫,和斯帕西的环境。以下是我目前所做的尝试:

  1. pypi2nix -V "3.6" -E gcc -E libffi -e spacy -e pandas -e numpy --default-overrides,后跟nix-build -r requirements.nix -A packages。我设法让第一个命令工作,但是第二个命令失败了,Could not find a version that satisfies the requirement python-dateutil>=2.5.0 (from pandas==0.23.4)

  2. 编写默认值.nix看起来像这样:with import <nixpkgs> {}; python36.withPackages (ps: with ps; [ spacy pandas scikitlearn ])。失败的是collision between /nix/store/9szpqlby9kvgif3mfm7fsw4y119an2kb-python3.6-msgpack-0.5.6/lib/python3.6/site-packages/msgpack/_packer.cpython-36m-x86_64-linux-gnu.so and /nix/store/d08bgskfbrp6dh70h3agv16s212zdn6w-python3.6-msgpack-python-0.5.6/lib/python3.6/site-packages/msgpack/_packer.cpython-36m-x86_64-linux-gnu.so

  3. 创建一个新的virtualenv,然后在所有这些包上运行pip install。Scikit learn安装失败,出现fish: Unknown command 'ar rc build/temp.linux-x86_64-3.6/liblibsvm-skl.a build/temp.linux-x86_64-3.6/sklearn/svm/src/libsvm/libsvm_template.o'

我想理想的情况是我希望用nix安装这个环境,这样我就可以用nixshell输入它,这样其他环境就可以重用相同的python包了。我该怎么做呢?尤其是由于这些包中有些包存在于nixpkgs中,而另一些只存在于Pypi上。在


Tags: store命令buildpandas环境spacylinuxlib