Help with blender, maya and python

Currently i am facing a problem with Maya 2009 throwing out some output error when i run it with the environment variable

PYTHONPATH=C:\PYTHON26;C:\PYTHON26\DLLs;C:\PYTHON26\LIB;C:\PYTHON26\LIB\LIB-TK;

But when i run blender, everything is working fine, no import site errors. And when i run Maya 2009 without the environment variable set, my Maya will be fine however, blender will say something like import site error. Is there a way to point blender to the python path without using the environment variable. Or is there other ways to bypass this error.

Heres my maya output log with PYTHONPATH enabled:

C:\PYTHON26\LIB\site.py:150: Warning: 'with' will become a reserved keyword in Python 2.6
'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "C:\Program Files (x86)\Autodesk\Maya2009\Python\lib\site-packages\maya\app\python.py", line 8, in <module>
    import sys, StringIO, traceback, re
  File "C:\PYTHON26\LIB	raceback.py", line 3, in <module>
    import linecache
  File "C:\PYTHON26\LIB\linecache.py", line 9, in <module>
    import os
  File "C:\PYTHON26\LIB\os.py", line 757
    bs = b""
           ^
SyntaxError: invalid syntax
Invalid Python Environment: Python is unable to find Maya's Python modules
Python Evironment:
  PYTHONHOME not set!
C:\PYTHON26\LIB\site.py:150: Warning: 'with' will become a reserved keyword in Python 2.6
  File "C:\PYTHON26\LIB\site.py", line 150
    with f:
         ^
SyntaxError: invalid syntax
  Python cannot find site module!
  Python cannot find sys module!
Traceback (most recent call last):
  File "C:\Program Files (x86)\Autodesk\Maya2009\Python\lib\site-packages\maya\app\python.py", line 8, in <module>
    import sys, StringIO, traceback, re
  File "C:\PYTHON26\LIB	raceback.py", line 3, in <module>
    import linecache
  File "C:\PYTHON26\LIB\linecache.py", line 9, in <module>
    import os
  File "C:\PYTHON26\LIB\os.py", line 757
    bs = b""
           ^
SyntaxError: invalid syntax
Invalid Python Environment: Python is unable to find Maya's Python modules
Python Evironment:
  PYTHONHOME not set!
C:\PYTHON26\LIB\site.py:150: Warning: 'with' will become a reserved keyword in Python 2.6
  File "C:\PYTHON26\LIB\site.py", line 150
    with f:
         ^
SyntaxError: invalid syntax
  Python cannot find site module!
  Python cannot find sys module!
Traceback (most recent call last):
  File "C:\Program Files (x86)\Autodesk\Maya2009\Python\lib\site-packages\maya\utils.py", line 10, in <module>
    import os, warnings, sys
  File "C:\PYTHON26\LIB\os.py", line 757
    bs = b""
           ^
SyntaxError: invalid syntax
Invalid Python Environment: Python is unable to find Maya's Python modules
Python Evironment:
  PYTHONHOME not set!
C:\PYTHON26\LIB\site.py:150: Warning: 'with' will become a reserved keyword in Python 2.6
  File "C:\PYTHON26\LIB\site.py", line 150
    with f:
         ^
SyntaxError: invalid syntax
  Python cannot find site module!
  Search path (sys.path):
    C:\Program Files (x86)\Autodesk\Maya2009\bin
    C:\PYTHON26
    C:\PYTHON26\DLLs
    C:\PYTHON26\LIB
    C:\PYTHON26\LIB\LIB-TK
    C:\Python26\Lib\site-packages
    C:\Program Files\Autodesk\Maya8.5\Python\lib\site-packages
    
    C:\Program Files (x86)\Autodesk\Maya2009\bin\python25.zip
    C:/Program Files (x86)/Autodesk/Maya2009/Python\DLLs
    C:/Program Files (x86)/Autodesk/Maya2009/Python\lib
    C:/Program Files (x86)/Autodesk/Maya2009/Python\lib\plat-win
    C:/Program Files (x86)/Autodesk/Maya2009/Python\lib\lib-tk
    C:\Program Files (x86)\Autodesk\Maya2009\bin
Traceback (most recent call last):
  File "C:\Program Files (x86)\Autodesk\Maya2009\Python\lib\site-packages\maya\app\startup\gui.py", line 6, in <module>
    import maya.app.startup.basic
  File "C:\Program Files (x86)\Autodesk\Maya2009\Python\lib\site-packages\maya\app\startup\basic.py", line 8, in <module>
    import maya, maya.app, maya.app.commands
  File "C:\Program Files (x86)\Autodesk\Maya2009\Python\lib\site-packages\maya\app\commands.py", line 3, in <module>
    import sys, os.path
  File "C:\PYTHON26\LIB\os.py", line 757
    bs = b""
           ^
SyntaxError: invalid syntax

Well, Blender 2.5 bundles python, but it is currently in beta. If you are trying to use 2.49, I wonder if there is a problem with the python version.

Blender may look for a python folder in its own directory before looking for one somewhere else on the system. So if you copy your python folder into your blender folder, it may pick up on it there.

I do not think that this is true. I think Blender checks for an installed version and uses the bundled one if it does not find any.

The error messages looks more like a problem with your python installation. b"" is a syntax error in my eyes. It seems your os.py is modified whyever. Maybe you should reinstall Python again, to get the original files.

[Edit]
… interesting. I checked the os.py of Blender2.49. It contains the same b"" code.
If that is vaid syntax, I do not know what it means.
[/Edit]

Another Idea:

Could it be that Maya needs Python 3?

Python 2 and Python 3 are not compatible.

But you could install both at different locations.

Provide Maya with the path to Python 3
Provide Blender 2.49 with the path to Python 2
Provide Blender 2.5x with the path to Python 3.

In worst case you need a startup script to set the paths.

Thanks, Monster. But any idea as to how do i create a startup script for blender 2.49. Anyways, i am using both 2.49 and 2.53beta. I just want to get a feel of the good 'old blender days, because in 2.53 the whole thing is different and a lot of tutorials is for 2.49. Thanks anyway people.
EDIT: Oh ya, can anyone provide me with what your enviroment variables look like; PYTHONPATH=???. Or there isn’t a need to use env variables. Please guide me. Thanks.

what OS are you on (Win, Linux, MAC) ?

Am using windows 7 professional x64. Thanks.