Win XP breve not respecting PYTHONPATH; Anyway to force native python installation?
I've never been able to get the python frontend working correctly. I'm beginning to think of just doing all my experiments with pysoy or soya3d instead of breve, as it would be less frustrating!
On ubuntu (hardy heron) I'm unable to use my native python installation because it is 64-bit and causes conflicts with breve. This isn't going to be fixed anytime soon, so fine, I'll just use the packaged one; except I cant use psyco or any optimized/custom libraries or modules because these aren't visible to breve- even if they were, some of them require python2.5 anyway.
On windows xp I've never been able to get python frontend working at all; despite fiddling with pythonpath, adding the python installation to my PATH env variable, and trying to figure out if anything else in the registry might be confusing breve, nothing I did worked. I think a lot of people have the same problem but just didn't report it,because theres quite a few times when its come up on the forums (i.e. import failed: module OS not found, etc etc) and I've never seen any resolution. I looked at the source code to see if anything stood out, but I just got more confused. It definitely calls import sys at some point, successfully; its only when trying to import os that it chokes. So what the heck interpreter is it using that can't find its OS modules?
Is there anyway on XP to force breve not to load python23.dll and just use the system version?

looking into it...
I will make it a priority for the next release to allow system-installed Pythons to work with breve. This might be a matter of changes to breve, or it might just be a matter of documenting the proper setup required to do so.
Additionally, I'm going to try updating the version included with Windows breve to 2.5.
The sys import works successfully -- I think -- because sys is an internal module that never accesses any on disk resources. Thus the path issues wouldn't matter for sys, but would matter for other modules.
In addition to PYTHONPATH, you may want to make sure PYTHONHOME is set appropriately as well. I believe that PYTHONPATH is needed for external modules, but PYTHONHOME is required for the main Python startup -- thus PYTHONHOME may be the more important variable in your situation..
- jon
Thanks Jon
IT's good to know you are working on it for the next release. How far along are you on that by the way? Do you have a data you are aiming to release it by? If I can help with testing or anything let me know.
Anyway by setting pythonhome I'm able to change how breve fails; Instead of not finding the os module now, it complains of invalid syntax when loading os because of changes in syntax from python 2.3 to 2.5.
In other words, I've been able to make breve's python interpreter load the correct modules; I've been unable to make breve use the actual native interpreter.
Heres the traceback if its of any interest
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "lib/classes\breve\__init__.py", line 2, in ?
import sys, os, math, random, array
File "C:\Python25\lib\os.py", line 134
from os.path import (curdir, pardir, sep, pathsep, defpath, extsep, altsep,
^
SyntaxError: invalid syntax
Failed to initialize Python frontend. breve will not be able to execute Python
files.
followup on custom Python installations
I did some testing and found I could easily load Pyton and load modules from a system wide Python 2.3 -- but not of course Python 2.5 because breve is compiled and linked against 2.3.
So I think simply changing to Python 2.5 should let you use the custom modules you need.
Not sure when the new release will be coming, but I can always make some new betas soon once I make the switch to Python 2.5, which I'm playing with now, so hopefully it shouldn't be too long...
- jon