Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pre-installed SciPy on Python #2650

Closed
pelegm opened this issue Aug 8, 2014 · 14 comments
Closed

Support pre-installed SciPy on Python #2650

pelegm opened this issue Aug 8, 2014 · 14 comments

Comments

@pelegm
Copy link

pelegm commented Aug 8, 2014

Many Python packages depend on SciPy so it would be helpful to have a recent SciPy installed for each supported Python platform. It can be installed manually using a quite simple process (as I've described in #2638), but it takes about 15 minutes, and it is not easy to guess the requirements without referring to this ticket.

@thedrow
Copy link

thedrow commented Aug 11, 2014

Actually the entire science stack takes quite a while to install.
NumPy, SciPy, scikit-learn, pandas, geopandas, statsmodels all require a significant time in order to compile.
Preinstalling those packages (or some of them) might be a good idea.

@BanzaiMan
Copy link
Contributor

@thedrow Could you give estimates on how long those packages take to compile?

@thedrow
Copy link

thedrow commented Aug 12, 2014

Without ccache and f90cache both NumPy and SciPy take about 15-20 minutes to compile each.
With ccache and f90cache (providing that the package has been compiled before) about 5 minutes each, sometimes less.
SciPy also needs a fortran compiler such as gfortran in order to compile.
statsmodels can take about 10 minutes to install and it requires pandas, patsy which take about 5 minutes to install each.
geopandas require libgeos-dev and libgdal1-dev which take about 5 minutes to install.
Installing geopandas itself can take another 5 minutes.

So if you have a projec that deals with machine learning and geographic distances the installation process is very long.

@dstufft
Copy link

dstufft commented Dec 23, 2014

Since Travis has a consistent environment, you might be able to just create a travis-ci wheel repository that pip will install from automatically. This will people install these projects in a pre-compiled fashion (and make things go faster) without needing to compile them during image build.

@cancan101
Copy link

It seems like people are using miniconda (see here and here) as a workaround. This is not ideal as miniconda creates its own virtualenv.

I would 👍 to see "scientific python" as a version of python that can be specified.

@nirum
Copy link

nirum commented Aug 19, 2015

Seconded, would love to see better scientific python support

@AndreaCensi
Copy link

Hi, I was wondering if the miniconda workaround is still the preferred way of installing Numpy and Scipy.

Basically if you do any kind of scientific computing using Python, you are going to use Numpy and Scipy.
Why not have them in the default image?

Note also that it is very tricky to install them using pip from sources.

trynthink added a commit to trynthink/scout that referenced this issue Nov 30, 2015
The default Travis-CI system image does not include scipy, so including it in requirements.txt will yield a build error. The current workaround employs miniconda to install both numpy and scipy, as referenced in travis-ci/travis-ci#2650. An alternate approach is proposed in travis-ci/travis-ci#2638.
@johnyf
Copy link

johnyf commented Jan 3, 2016

Another workaround is to use apt and allow system-wide site-packages, as described here.

@Samreay
Copy link

Samreay commented Apr 28, 2016

Has there been any development on this issue? Whether it be a scientific-python distribution we can access, or is the current fix still to use work arounds?

@peterjc
Copy link

peterjc commented Oct 7, 2016

Nowadays there are pre-compiled binary wheels for NumPy and SciPy available via pip, which work nicely with TravisCI, e.g.

pip install --only-binary=numpy,scipy numpy scipy

If you leave out the --only-binary=numpy,scipy bit there is a chance pip would end up trying to compile things (and fail or take ages).

@thorade
Copy link

thorade commented Dec 13, 2016

@peterjc When I copy&paste your pip install command I get no such option: --only-binary from Travis. Did I miss anything?

PS: This is my first day as Travis user & the very first line of code I wrote into the .travis.yml file was for installing scipy, leading me here...

@dstufft
Copy link

dstufft commented Dec 13, 2016

@thorade You probably need to first do pip install --upgrade pip setuptools wheel.

muupan added a commit to chainer/chainerrl that referenced this issue Jan 30, 2017
telegraphic added a commit to telegraphic/hickle that referenced this issue Mar 31, 2017
scipy is causing issues with travis-ci, trying some tips off travis-ci/travis-ci#2650
albertz added a commit to rwth-i6/returnn that referenced this issue Apr 27, 2017
KrisThielemans pushed a commit to SyneRBI/SIRF-SuperBuild that referenced this issue Apr 29, 2017
Use pip as opposed to apt-get to install numpy as Travis uses a
virtualenv. See travis-ci/travis-ci#2650
SLongofono pushed a commit to SLongofono/Python-Misc that referenced this issue Jul 12, 2017
@BanzaiMan
Copy link
Contributor

Closing this now. Perhaps we can also document #2650 (comment).

jzacsh added a commit to jzacsh/neuralnets-cmp464 that referenced this issue Sep 6, 2017
two approaches at play here; before this CL is a gist[1] by third-party
to travis; *as of* this CL is a comment[2] about "it works this way" on
the travis-ci issue queue. hopefully the latter is correct

[1]: https://gist.github.com/dan-blanchard/7045057
[2]: travis-ci/travis-ci#2650 (comment)
JamesPHoughton added a commit to SDXorg/pysd that referenced this issue Sep 28, 2017
rlmv added a commit to wmayner/pyphi that referenced this issue Mar 8, 2018
Install NumPy and SciPy from PyPi binaries. See
travis-ci/travis-ci#2650
mroberge added a commit to mroberge/hydrofunctions that referenced this issue May 10, 2018
See issue travis-ci/travis-ci#2650 for the suggestion to update pip and
request the wheels for scipy and numpy.

travis-ci/travis-ci#2650 (comment)
@mroberge
Copy link

I found that using pip to install binaries worked really well for me- I was able to cut my testing in Python 3.4 down from 9 minutes to less than 1 minute. Python 3.5 and 3.6 already have numpy in their environments, so this didn't speed them up by more than a few seconds. I just added this to the install section:
pip install --upgrade pip setuptools wheel
pip install --only-binary=numpy,scipy numpy scipy

My complete .travis.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests