简体   繁体   English

根据apt库构建一个conda包

[英]Build a conda package relying on an apt library

I am building a scientific python project that relies on a python package ( scikits.sparse ) providing a binding to a C/Fortran library ( libsuitesparse-dev ) that can be installed through apt-get or yum but is virtually impossible to properly install manually. 我正在构建一个科学的python项目,它依赖于一个python包( scikits.sparse )提供一个绑定到C / Fortran库( libsuitesparse-dev ),可以通过apt-getyum安装但实际上不可能正确安装。

I would like to make my package available to users on all the platforms and the best way I can see to do it is to use a conda package build with conda skeleton and then translate to other platforms. 我想在所有平台上向用户提供我的软件包,我可以看到最好的方法是使用带有conda skeleton的conda软件包构建,然后转换到其他平台。 However I am not sure how well conda will manage external library dependencies from apt-get and was wondering if I needed to do anything else to make it work in addition to the official instructions . 但是我不确定conda将如何从apt-get管理外部库依赖项,并且想知道除了官方指令之外我是否还需要做任何其他事情来使其工作。

I am not sure how well conda will manage external library dependencies from apt-get 我不确定conda将如何从apt-get管理外部库依赖项

conda will not managed external libraries through apt-get but through it's own package management system. conda不会通过apt-get管理外部库,而是通过它自己的包管理系统。

apt and conda are two different and independant package management systems. aptconda是两个不同且独立的包管理系统。 One is the official debian/ubuntu package manager and the other is an additional package manager such as pip or npm . 一个是官方debian / ubuntu包管理器,另一个是额外的包管理器,如pipnpm Each of them will have their own set of installed packages and their own database. 他们每个人都有自己的安装包和他们自己的数据库。

You can distribute your project through apt or conda or even both, but your users will have to choose one channel of distribution. 您可以通过aptconda或甚至两者分发您的项目,但您的用户必须选择一个分发渠道。

There is already a conda recipe for the scikits.sparse library you can install it via 已经有scikits.sparse库的conda配方,您可以通过它安装它

conda install -c https://conda.anaconda.org/menpo scikits.sparse

If you want to include it in one of your recipe you have to add the menpo channel in your .condarc : 如果你想将其纳入你的食谱之一,你必须在你的加入menpo通道.condarc

channels:
  - defaults
  - menpo 

Then in your recipe you can require scikits.sparse such as: 然后在你的食谱中你可以要求scikits.sparse,例如:

requirements:
  build:
    - python
    - setuptools

  run:
    - python
    - scikits.sparse

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM