[Stackless] Compiling stackless with PyQt4?

Caleb J. Howard caleb at howlor.com
Fri Mar 30 08:19:53 CEST 2007


mm-kay.  so I've tried several variations - 

- I have a cPython/PyQt4/Eric4 developer environment already installed, and 
working with projects.  I am trying not to break this while I investigate 
stackless python's multithreadletting advantages.

- I want to set up StacklessPython with PyQt4 to develop a small tool to 
capture and store serial data, as well as send keyboard-triggered serial 
commands out rs232.  I hope to use PyQt4 for the UI development. 

- I want to try to do this as a first foray into multithreaded coding.  It's 
be nice to start out having a decent scheduler in place.  I like baby steps, 
and borrowed code.  My broader interest lies in agent-based applications.

- I've compiled with the --enable-unicode=ucs4, as Santiago, and Richard 
suggested, and that corrected the problem I had previously reported.

- I tried recompiling StacklessPython2.4, and StacklessPython2.5.  My version 
of PyQt4 balks, complaining about version incompatibilities when I try to 
import it from StacklessPython2.5.

- Stackless2.4 is configured with:
	./configure --prefix=/usr/stackless_python --enable-unicode=ucs4

- Stackless Python is installed in /usr/stackless_python.  The preexisting 
cPython is installed in /usr/bin/python.

- I have put stackless_python/bin/ first in $PATH

- I've been running PyQt4's configure.py using StacklessPython2.4:
	python ./configure.py -d /usr/PyQt4/ -c -w

- make install puts PyQt4 in /usr/PyQt4, which exists aside a preexisting 
PyQt4 installation, which is working with my cPython.

- I can start (stackless) python, and import PyQt4:
	> !python
	Python 2.4.3 Stackless 3.1b3 060516 (#3, Mar 27 2007, 23:42:33)
	[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
	Type "help", "copyright", "credits" or "license" for more information.
	>>> import PyQt4
	>>>                

- If I try to import some part of PyQt4, it segfaults.
	> !python
	Python 2.4.3 Stackless 3.1b3 060516 (#3, Mar 27 2007, 23:42:33)
	[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
	Type "help", "copyright", "credits" or "license" for more information. 
	>>> from PyQt4 import QtGui
	Segmentation fault


If anyone can give me some hints or pointers based on the above information, 
or even better - an awesome shopping list of specific downloads, compile 
configurations and installs to perform to guarantee all compatibility, that 
would be *greatly* appreciated  (of course).

If I had more experience, I could have confidence that this effort will bear 
timely fruit.  I have to finish my little serial app about a month ago.  If 
anyone can lend their experience and confidence in Stackless Python, I think 
it sounds ideal to my interests and needs.  Barring that, I'll probably have 
to fall back on cPython threads, which seem more difficult to keep synced.  

I'll probably have to give up on stackless if I can't get this running by 
Saturday, so all help will be greatly, greatly appreciated.

Thanks!


On Monday 26 March 2007 00:49, Caleb J. Howard wrote:
> Does anyone have a simple step-by-step description of the (a) way to
> configure stackless python (I have v2.4 or v2.5) to work with PyQt4?
>
> I'm new to stackless, but have been using PyQt4 with cPython.  I'd love to
> exequte this example code from:
> 	http://code.google.com/p/stacklessexamples/wiki/StacklessGUI
> called:
> 	ProdConPyQt.py
>
> When I try to link my
> 	/usr/stackless_python/lib/python2.5/site-packages/
> dir into my stackless source tree, or install dir, I get the following
> error:
>
> ===================
>
> > /usr/stackless_python/bin/python ProdConPyQt.py
>
> ProdConPyQt.py:20: RuntimeWarning: Python C API version mismatch for module
> PyQt4.QtGui: This Python has API version 1013, module PyQt4.QtGui has
> version 1012.
>   from PyQt4 import QtGui, QtCore
> ProdConPyQt.py:20: RuntimeWarning: Python C API version mismatch for module
> sip: This Python has API version 1013, module sip has version 1012.
>   from PyQt4 import QtGui, QtCore
> Traceback (most recent call last):
>   File "ProdConPyQt.py", line 20, in <module>
>     from PyQt4 import QtGui, QtCore
> ImportError:
> /usr/stackless_python/lib/python2.5/site-packages/PyQt4/QtCore.so:
> undefined symbol: PyUnicodeUCS4_GetDefaultEncoding
>
> =========================
>
>
> I appreciate all encouragement and experienced advice.
>
> Thanks!
>
>
> -caleb
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>         caleb at howlor.com (home) - choward at imageworks.com (work)
>                    http://howlor.com/CalebMain.html
>                     "Live slow - Die old." -ronda
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> _______________________________________________
> Stackless mailing list
> Stackless at stackless.com
> http://www.stackless.com/mailman/listinfo/stackless

-- 

-caleb

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
        caleb at howlor.com (home) - choward at imageworks.com (work)
                   http://howlor.com/CalebMain.html
                    "Live slow - Die old." -ronda
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless



More information about the Stackless mailing list