2

I am trying to install http://scikit-learn.org/stable/index.html# on raspbmc. AND I would like to use python3. Since scikit-learn supports only python3 > 3.3, and pi comes with 3.2 I need to build everything.

So I built python 3.4, added pip to proceed with other builds/installs using pip built numpy (one of scikit-learn dependency)

I am stuck on building scipy (one more scikit-learn dependency) scipy build failed with gcc being terminated and suggestion to file gcc bug report. I tried newer gcc (4.8 instead of 4.6 that came with raspbmc) and got the same error.

Before I start digging into gcc and scipy build script: Is there an easier way to get scikit-learn/python3 on raspberry pi?

Thank you!

P.S. I realize this is not purely programming Q, but scikit-learn site points to stackoverflow as a place for questions.

5
  • 1
    Hi Dima, the way I did it on my Pi was with continuum.io/downloads#34 they now have a 3.4 version and the typical 2.7. Good luck. Commented Nov 2, 2014 at 16:11
  • 2
    I second that. Don't try to compile scipy if you don't have to. There are several good scientific python distributions around, and anaconda, which @KLDavenport suggests is the one I usually recommend. Commented Nov 2, 2014 at 17:40
  • Thank you! I read about anaconda and got impression they do not have distribution for ARM processors. KLDavenport, did you use install for Linux-64? repo.continuum.io/anaconda3/Anaconda3-2.1.0-Linux-x86_64.sh. The only thing I found about installing anaconda on pi is this post continuum.io/blog/raspberry and it seems to be with python 2.7 and very limited set of packages. Commented Nov 11, 2014 at 19:44
  • This is the answer from Continuum Analytics: Hello Dima, we are currently not planning to support Python 3 for the Raspberry PI. The Python 2.7 we did a year and a half ago was only done because of PyCon 2013. We currently do not actively support packages for the Raspberry PI. Regards Ilan Commented Nov 14, 2014 at 23:29
  • Tried again with new Raspbian (Jessie). It was slightly faster because I did not need to build python 3.4, but eventually I hit the same problem with gcc building scipy. Bug report: gcc.gnu.org/bugzilla/show_bug.cgi?id=77662 Commented Sep 20, 2016 at 13:27

1 Answer 1

3

Install Raspbian Jessie Lite, and run these commands:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python3-scipy python3-pip
sudo pip3 install scikit-learn

Run scikit-learn tests:

sudo pip3 install nose
sudo nosetests -v sklearn
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.