Orange Forum • View topic - Locating the PCA Widget

Locating the PCA Widget

A place to ask questions about methods in Orange and how they are used and other general support.

Locating the PCA Widget

Postby JoeM » Mon Dec 10, 2012 14:00

Hello,

I cannot find the PCA widget, as showed in the doc (Unsupervised > PCA)
http://orange.biolab.si/docs/latest/widgets/rst/

I can use it from python flawlessly, but the widget would be SO useful.

I use the latest dev version from the repo ( hg pull; hg update; python setup.py build ) (2.6a2.dev-a66a74b)

Am I doing something wrong. Also, I noticed that during the build (I used some older version, do not know precisely which) the network analysis stuff (Network File, Network From Distances, Net Explorer) disappeared. This is not a problem, I did not use it, I just thought it might be relevant. The PCA widget was never there...

Could you give some advice?

Thanks in advance,
JM

Re: Locating the PCA Widget

Postby Ales » Wed Dec 12, 2012 11:17

The PCA widget requires 'orangeqt' module which is not build by default by the setup.py script.

You can run either run 'python setup.py build_pyqt_ext build' or 'cd source/orangeqt && python setup.py build' (you will need sip installed for this to work).

I don't think this is documented anywhere. We will have to fix this.

Re: Locating the PCA Widget

Postby JoeM » Thu Dec 13, 2012 12:03

Hmm, unfortunately, it fails... Any ideas how to fix it?
Thanks

Code: Select all
 $ cd source/orangeqt && python setup.py build
running build
running build_ext
Calling: moc -o build/temp.linux-x86_64-2.7/point.moc point.h
Calling: moc -o build/temp.linux-x86_64-2.7/unconnectedlinescurve.moc unconnectedlinescurve.h
Calling: moc -o build/temp.linux-x86_64-2.7/plot.moc plot.h
Calling: moc -o build/temp.linux-x86_64-2.7/multicurve.moc multicurve.h
multicurve.h:0: Note: No relevant classes found. No output generated.
Calling: moc -o build/temp.linux-x86_64-2.7/networkcurve.moc networkcurve.h
networkcurve.h:0: Note: No relevant classes found. No output generated.
Calling: moc -o build/temp.linux-x86_64-2.7/plotitem.moc plotitem.h
Calling: moc -o build/temp.linux-x86_64-2.7/curve.moc curve.h
building 'orangeqt' extension
/usr/bin/sip -k -j 1 -t WS_X11 -t Qt_4_8_1 -c build/temp.linux-x86_64-2.7 -b build/temp.linux-x86_64-2.7/orangeqt.sbf -I /usr/share/sip/PyQt4 orangeqt.sip
sip: Deprecation warning: the -k flag is deprecated
sip: Deprecation warning: orangeqt.sip:1: %Module version number should be specified using the 'version' argument
sip: QGraphicsView has not been defined
error: command '/usr/bin/sip' failed with exit status 1

 $ sip -V
4.13.2


Re: Locating the PCA Widget

Postby Ales » Thu Dec 13, 2012 12:18

Depending on which distribution you are using, the PyQt4 sip class definitions might be missing (check '/usr/share/sip/PyQt4' directory). They are probably contained in a separate package ('python-qt4-dev' or something similar).

Re: Locating the PCA Widget

Postby JoeM » Thu Dec 13, 2012 15:00

Hmm, I have both python-sip-dev python-qt4-dev packages installed (I have Ubuntu 12.04.1 LTS), the directory seems to be full ;-) Most importantly the file mentioned by the sip is there:

Code: Select all
/usr/share/sip/PyQt4/QtGui/qgraphicsview.sip


Does not it have something to do with the deprecation warnings?

Also, if I run the sip manually with different qt version, the error changes. Not sure this is relevant though...

Code: Select all
 $ /usr/bin/sip -k -j 1 -t WS_X11 -t Qt_4_8_1 -c build/temp.linux-x86_64-2.7 -b build/temp.linux-x86_64-2.7/orangeqt.sbf -I /usr/share/sip/PyQt4 source/orangeqt/orangeqt.sip
sip: Deprecation warning: the -k flag is deprecated
sip: QGraphicsView has not been defined

 $ # here I changed the 4_8_1 to 4_2_0

 $ /usr/bin/sip  -j 1 -t WS_X11 -t Qt_4_2_0 -c build/temp.linux-x86_64-2.7 -b build/temp.linux-x86_64-2.7/orangeqt.sbf -I /usr/share/sip/PyQt4 source/orangeqt/orangeqt.sip
sip: QGraphicsObject has not been defined

Re: Locating the PCA Widget

Postby Ales » Thu Dec 13, 2012 15:43

It's the '-t Qt_4_8_1' flag that seems to be at fault . Try this
Code: Select all
python setup.py build --sip-opts='-t Qt_4_8_0'

This seems to be a problem with the setup.py script which falsely assumes that PyQt4 was build against the current Qt version (#1258).

Re: Locating the PCA Widget

Postby JoeM » Thu Dec 13, 2012 16:31

The command you reccomended raises the error:

Code: Select all
error: option --sip-opts not recognized


But I hardcode the 4_8_0 into the source/orangeqt/setup.py directly and it compiled ok. However, running bin/orange-canvas still does not show the PCA. Is this the right command?

I built the orange using the
Code: Select all
python setup.py build_pyqt_ext build

Re: Locating the PCA Widget

Postby Ales » Thu Dec 13, 2012 17:32

JoeM wrote:The command you reccomended raises the error:

Code: Select all
error: option --sip-opts not recognized

Sorry, that should have been
Code: Select all
python setup.py build_ext --sip-opts='-t Qt_4_8_0'


JoeM wrote:However, running bin/orange-canvas still does not show the PCA. Is this the right command?

I built the orange using the
Code: Select all
python setup.py build_pyqt_ext build

It seem that for the subsequent install (or develop) command to work all the commands must be included in a single setup.py call.
Code: Select all
python setup.py build_pyqt_ext build install # build is redundant here

If you are building in developer mode you also need to pass '-i' (--inplace) flag
Code: Select all
python setup.py build_pyqt_ext -i develop

Re: Locating the PCA Widget

Postby JoeM » Mon Dec 17, 2012 15:01

Good, thank you, it is there!


Return to Questions & Support



cron