ubuntu下面编译安装Orange的step by step

时间:2021-10-29 16:36:37

根据官网上的介绍可以在/etc/apt/source.list文件中添加:

#these below are added by walle 2011-8-17

deb http://archive.canonical.com/ubuntu maverick partner

deb http://orange.biolab.si/debian squeeze main

deb-src http://orange.biolab.si/debian squeeze main

然后:sudo aptitude update

然后:sudo aptitude install orange-canvas

如果你的ubuntu版本为10.10及以下。通常会出错。说什么该软件包依赖于python2.6.6-3而你安装的是python2.6.6-2然后就装不了。

此种情况后只能从源码编译安装:

This document explains how to compile and install Orange on a Linux system. 

The following commands were tested on Ubuntu 9.04 and Ubuntu 11.04 and should

be modified accordingly for other distributions. 

 

1. OBTAINING SOURCES

 

You can download the Orange's nightly packed sources from  

http://www.ailab.si/orange/nightly_builds.html and extract the archive.

 

An alternative is to check out the newest revision directly from SVN 

repository. In latter case, the following should do the job:

 

sudo apt-get install subversion # install the SVN client

 

svn co http://www.ailab.si/svn/orange/trunk/orange

cd orange

svn co http://www.ailab.si/svn/orange/trunk/source

 

2. DEPENDENCIES

 

2.1 For Python scripting 

 

If you only need the scripting interface, accessible through python, 

the dependencies are easier to fulfil. Only the common building tools and 

python extensions for imaging, graphs and computation with matrices are needed.

 

sudo apt-get install make g++ python-dev python-numpy python-matplotlib python-imaging

 

(For some older Ubuntu releases, it might be necesarry to replace the

python-numpy with python-numpy-ext.)

 

This suffices for Orange scripting version to work.

 

2.2 Orange Canvas (widgets)

 

If you would like to use Orange Canvas, you will need to install PyQWT 5.1.

On Ubuntu 9.10 and newer use:

 

sudo apt-get install python-qwt5-qt4

 

On Ubuntu 9.04 it needs to be compiled from source. To fulfill its compilation

dependencies use:

 

sudo apt-get install python-qt4-dev libqwt5-qt4-dev pyqt4-dev-tools sip4

 

Then download PyQWT version 5.1.0 (.tar.gz package) from:

http://sourceforge.net/projects/pyqwt/files/

 

Extract it and move inside the extracted folder. Next, use the following. 

(For other systems, substitute the install path with your python package

directory.)

 

cd configure

python configure.py -Q ../qwt-5.1 --module-install-path=/usr/lib/python2.6/dist-packages/PyQt4/Qwt5

make -j8

sudo make install

 

3. COMPILING AND INSTALLING ORANGE

 

Move to the directory containing the downloaded Orange's sources. Compile the 

C++ sources:

 

cd source

make     #需要注意的是笔者在该步骤出了问题,首先是无法执行cmake,这个简单。sudo aptitude install amake .然后报错,无法执行sip命令,解决方法是sudo aptitude install python-sip-dev,然后就ok了

cd .. #to move to main orange directory

 

Transfer files. Tar is used instead of cp because it can exclude unnecessary 

files and keeps symbolic links. For other systems, substitute the install path

with your python package directory.

 

sudo mkdir /usr/lib/python2.6/dist-packages/orange

tar -cf - --exclude='.svn' * | sudo tar --no-same-owner -xf - -C /usr/lib/python2.6/dist-packages/orange

 

sudo sh -c "echo '/usr/lib/python2.6/dist-packages/orange' > /usr/lib/python2.6/dist-packages/orange.pth"

 

4. RUNNING

 

To use Orange in python scripts, try importing "orange" and "orngStat" 

in python interpreter. It should work flawlessly.

 

You can run the Orange Canvas (widgets) with:

python /usr/lib/python2.6/dist-packages/orange/OrangeCanvas/orngCanvas.pyw