In a recent project, I needed to setup a web server that could solve quadratic programs via a simple API. Conveniently, as of January 15th, 2015, CVXOPT is included in the list of packages that can be installed using conda (Linux and Mac only). Thanks to the conda buildpack for Heroku created by Kenneth Reitz, the process of adding CVXOPT to a Python app is fairly simple. You can follow this same procedure to add popular scientific python packages (like numpy, scipy, scikit-learn, statsmodels, and pandas) to a Heroku app.

I. Buildpack

1.0 New Apps

If you are starting a new Python app on Heroku, you can add the conda buildpack using the command:

$ heroku create YOUR_APP_NAME --buildpack

1.1 Existing Apps

If you have already setup a Python app on Heroku, you can add the conda buildpack to the existing app using the command:

$ heroku config:add BUILDPACK_URL=

Or, if you need to specify the app by name:

$ heroku config:add BUILDPACK_URL= --app YOUR_APP_NAME

II. Use

2.1 Requirements

To use the buildpack, you will need to include two text files in the app directory, requirements.txt and conda-requirements.txt. Just as with the standard Python buildpack, the requirements.txt file lists packages that should be installed using pip. Packages that should be installed using conda are listed in the conda-requirements.txt file. Some of the most useful scientific packages include cvxoptnumpy, scipy, scikit-learn, statsmodels, and pandas. The full list of available conda packages can be found at

For example:

$ cat requirements.txt



$ cat conda-requirements.txt


That’s it! You can now add CVXOPT to a Python app on Heroku. 

2.2 With ATLAS

CVXOPT recommends using ATLAS libraries for a performance improvement over standard BLAS & LAPACK libraries. If you want to use CVXOPT with ATLAS instead of BLAS & LAPACK , I have forked Mr. Reitz’s repository and modified the conda buildpack to accept a custom-requirements.txt file. The file lists packages that should be installed using a customized installation procedure. Currently, only cvxopt-atlas is supported.

To use my forked conda buildpack (fair warning, the repository may not have the most recent version of conda):

$ heroku config:add BUILDPACK_URL=

Include the custom-requirements.txt file in the app directory:

$ cat custom-requirements.txt

The cvxopt-atlas install procedure will use the atlas library available through conda


I hope this short tutorial will save someone from a few hours of frustration!



  1. Peter
    November 20, 2015

    Nice work! Thanks for this tutorial. I’ve been trying to get sklearn working on Heroku for way to long. This was the only build pack I got to work.

  2. rigoxls
    December 16, 2015

    Yes i agree , i tried 2 buildpacks before using this without success, this one is the only one who works without bugs, warnings, errors…

    thanks… good post


Leave a Reply