Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

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. 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.

like image 285
chiffa Avatar asked Oct 30 '22 14:10

chiffa


1 Answers

I am not sure how well conda will manage external library dependencies from apt-get

conda will not managed external libraries through apt-get but through it's own package management system.

apt and conda are two different and independant package management systems. One is the official debian/ubuntu package manager and the other is an additional package manager such as pip or npm. 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.

There is already a conda recipe for the scikits.sparse library you can install it via

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:

channels:
  - defaults
  - menpo 

Then in your recipe you can require scikits.sparse such as:

requirements:
  build:
    - python
    - setuptools

  run:
    - python
    - scikits.sparse
like image 198
Ortomala Lokni Avatar answered Nov 09 '22 05:11

Ortomala Lokni