[Pythonmac-SIG] Pythonw and VPython and Fink

Bob Ippolito bob at redivi.com
Tue Feb 14 23:16:34 CET 2006


On Feb 14, 2006, at 1:28 PM, Matthias Milczynski wrote:

> I would like to use SPE (cool Python editor) with vpython, that I
> installed with fink (unfortunately there is no other possibility
> yet). My vpython stuff is located in /sw/lib/python2.4/site-packages/
> visual, but I run SPE with /usr/local/bin/pythonw2.4. When I try to
> run any vpython script I encounter the following error:
>
> ///////////////////////////////////////////////////////////////
>
> Traceback (most recent call last):
>    File "bounce.py", line 1, in ?
>      from visual import *
>    File "/sw/lib/python2.4/site-packages/visual/__init__.py", line
> 15, in ?
>      import array_backend
>    File "/sw/lib/python2.4/site-packages/visual/array_backend.py",
> line 1, in ?
>      import cvisual
> ImportError: Failure linking new module: /sw/lib/python2.4/site-
> packages/cvisualmodule.so: Symbol not found: _PyObject_IsInstance
>    Referenced from: /sw/lib/python2.4/site-packages/cvisualmodule.so
>    Expected in: /Library/Frameworks/Python.framework/Versions/2.4/
> Resources/Python.app/Contents/MacOS/Python
>
>
> ///////////////////////////////////////////////////////////////
>
> I assume that the solution of this problem would be to somehow get a
> fink-based pythonw, but this seems to be not avaiable.
> Can anybody help me with this?

You can't (reliably) import modules from one Python with another.  It  
simply just doesn't work like that.  Not too much you can do about  
it.  pythonw is totally irrelevant.  There is *nothing special* about  
pythonw, it is just a shell script or simple C program that  
effectively manipulates argv[0] and then launches a real Python  
interpreter.

I can think of three possible workarounds:
1. Somehow configure SPE to use /sw/bin/python to fork its  
subprocesses (hopefully it uses subprocesses!)
2. Get or build a VPython that is compatible with Python.framework
3. Get or build a SPE for Fink.

-bob



More information about the Pythonmac-SIG mailing list