[PYTHON] Install CVXOPT, NumPy, SciPy on Travis CI

Overview

At Travis CI, CVXOPT, NumPy, [SciPy] I want to test a Python program using (http://www.scipy.org/). Since these libraries could not be installed by pip alone, we will summarize other necessary packages.

** Fixed by CVXOPT not including SuiteSparse (February 5, 2017) **

Premise

It is assumed that the libraries required to execute the test are written in requirements.txt. At this time, Travis will automatically perform pip install -r requirements.txt, so the install step is unnecessary.

.travis.yml In summary, libblas-dev and liblapack-dev are used to install CVXOPT. Since gfortran is required to install SciPy, prepare it using ʻaddons.apt.packages of .travis.yml`.

Also, since CVXOPT has stopped including Suite Sparse, you need to prepare it yourself. This procedure is described in before_install.

yaml:.travis.yml


language: python
python:
  - 2.7
addons:
  apt:
    packages:
      - libblas-dev
      - liblapack-dev
      - gfortran
before_install:
  - wget http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.5.3.tar.gz
  - tar -xf SuiteSparse-4.5.3.tar.gz
  - export CVXOPT_SUITESPARSE_SRC_DIR=$(pwd)/SuiteSparse
script:
  - ./unittest_script.py

In older versions, it seems that sudo apt-get install was used for before_install, but in the case of container base, sudo cannot be used and ʻaddons.apt` seems to be used.

By the way, this time requirements.txt is

requirements.txt


cvxcanon>=0.1.1           # via cvxpy
cvxopt>=1.1.9
cvxpy>=0.4.8
cycler>=0.10.0            # via matplotlib
ecos>=2.0.4               # via cvxpy
fastcache>=1.0.2          # via cvxpy
functools32>=3.2.3.post2  # via matplotlib
matplotlib>=2.0.0
multiprocess>=0.70.4      # via cvxpy
numpy>=1.12.0
pyparsing>=2.1.10         # via matplotlib
python-dateutil>=2.6.0    # via matplotlib
pytz>=2016.10             # via matplotlib
scipy>=0.18.1
scs>=1.2.6                # via cvxpy
six>=1.10.0               # via cvxpy, cycler, matplotlib, python-dateutil
subprocess32>=3.2.7       # via matplotlib
toolz>=0.8.2              # via cvxpy

Is.

Recommended Posts

Install CVXOPT, NumPy, SciPy on Travis CI
Install numpy on Marvericks
Install and run Python3.5 + NumPy + SciPy on Windows 10
Install Numpy on virtualenv on Windows
Install cvxopt on 64bit Anaconda
Use Numpy, Scipy, scikit-learn on Heroku
Install Scipy on Mac OS Sierra
Install Scipy
Install scipy on Linux without internet connection
Use Numpy, Scipy, scikit-learn on Amazon Linux
scipy stumbles with pip install on python 2.7.8
How to install NumPy on Raspberry Pi
Install NumPy, SciPy, Matplotlib with Homebrew on OS X (as of November 2015)
Install Python3, numpy, pandas, matplotlib, etc. on Windows
Install Numpy + atlas
Very easy to install SciPy on Mac OS X
Settings for testing C ++ 11 Python modules on Travis CI
Install mecab on Marvericks
Install Tensorflow on Mac
Install TensorFlow on Ubuntu
Install python on WSL
Install Faiss on CentOS 7
Install pyenv on mac
Install pip on Mavericks
Install Python on Pidora.
Install mongodb on termux
Install Scrapy on python3
Install docker on Fedora31
Install numba on CentOS 7.2
Install Python on Mac
Install Python 3 on Mac
Install Plone (4.3.6) on MacOSX (10.10.3)
Install Python3.4 on CentOS 6.6
Install JModelica on Ubuntu
Upgrade Travis CI pip
Install Anaconda on Windows 10
Install python on windows
Install enebular-agent on Chromebook
Install pycuda on Windows10
Install mecab-python on CentOS
Install Python 2.7.3 on CentOS 5.4
Install aws-cli on MacPorts
Install pygraphviz on Windows 10
Install Docker on AWS
Install Python 3.3 on Ubuntu 12.04
Install Chainer 1.5.0 on Windows
Install Python 3.4 on Mac
Install Caffe on Mac
Install Theano on Ubuntu 12.04
Install pyenv on OSX
Install mecab on mac
Install awscli on centos7
Install angr on Ubuntu 18.04
Install Chainer on CentOS 6.7
Install mecab-python on Mac
Install pip / pip3 on Ubuntu
Install Python 3.6 on Docker