Old Python ref crashing blender

I posted this over in the support area, but didn’t get a solution so I thought folks over here might have some ideas. Keep in mind, I know pretty much nothing about python.

I’m trying to run Blender on an Intel iMac running OSX 10.6.8 and Blender crashes on launch. The crash report doesn’t give much useful info, but running blender from the terminal give this error message:

ndof: 3Dx driver not found
found bundled python: /Applications/blender-2.63-release-OSX_10.6_x86_64/blender.app/Contents/MacOS/2.63/python
Fatal Python error: Py_Initialize: unable to load the file system codec
File “/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/encodings/init.py”, line 109
raise CodecRegistryError,
^
SyntaxError: invalid syntax
Abort

It looks like there is something trying to call some python 2.3 script and that is conflicting with Blender wanting to use python 2.63.

Here’s what I’ve done:

  1. Delete all old installations of Blender
  2. Downloaded a fresh copy of Blender 2.63
  3. Deleted the hidden file .B.blend in my home directory

I know that there is something, somewhere in my user account that is causing this because I created a new user account and Blender runs fine there. I just need some help tracking down where this old python reference is so I can delete it.

Thanks,
Ryan

Mac isn’t my main OS so not sure if this will work. But I did a quick search and found this: “previously I have used Python 2.x and when I removed that version and next installed Python32, PYTHONPATH in system variabled indicated still to Python2.x. Removing all python paths to old version solved the problem.”

So the problem may be your PYTHONPATH.

Check out this link and see if it helps?

This line
… bundled python: /Applications/blender-2.63-release-OSX_10.6_x86_64/blender.app/Contents/MacOS/2.63/python

is telling that python (3.2) comes bundled with blender 2.63.

If you look into the python code at
/Applications/blender-2.63-release-OSX_10.6_x86_64/blender.app/Contents/MacOS/2.63/python/lib/python3.2/
you will find a system independent Python 3.2 package.

This line:
…File “/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/encodings/init.py”…
is telling that Blender is tracing your system library for registering any set of encoding definition like utf-8 relevant to your computer system. The encoding files are stored in:
/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/encodings/

Python 2.3 is shipped with OS X. And IMHO there is no definition for handling 3Dx-files

My guess would be that you are using an ancient script that depends on this encoding.

As Blender seems to be working with a new account, perhaps you should delete the folder
/Users/***/Library/Application Support/Blender/2.63 or rename it for trouble shooting.

“***” should be replaced by your account name. This is where blender stores individual scripts and addons.

Then restart Blender and don’t load previous setups when asked. This will create a new empty “2.63” folder. After that you may load your additional addons one at a time , save as default and restart. If any script is causing the trouble your error message will show up again.

HTH

Thanks for the help. I followed the link to the PYTHONPATH info and was able to find the file that was setting this to python2.3. At first, I thought I’d just update all the references to 2.6, but found that there are some 2.3 scripts that are listed that don’t exist in 2.6. Then I thought, what happens when Blender switches to 2.7? I’ll be in the same boat and will have to remember what I did to fix it.

Then I took HTH’s advice and took a look at the user account that works and found that it doesn’t even have the same file that specifies PYTHONPATH, so I renamed the file as a backup (in case deleting it causes problems) and rebooted. Blender started up perfectly and I haven’t seen any problems.

thanks for your help. I’ve been trying to sort this out for a long time.

Ryan

Just an additional remark.

The PYTHONPATH variable has been set to Python 2.3 by Apple in OSX.

If you haven’t installed any other Python package this could leave your Mac in an undefined state for other programs which get their information about the installed version through the PYTHONPATH variable. If you have rerouted the Python pass to the Blender App- folder you might have to redefine this with future Blender versions.

Perhaps you should visit thePython download page and install one of the packages. You can install multiple versions on your system. I would suggest to install 3.2.3. and then 2.7.3 . The reason is that 3.x has introduced some incompatible language elements to the 2.x series whereas all strains of 2.x are downward compatible. As each installation is asking you to set the PYTHONPATH variable, this is the easiest way to leave OS X in a consistent state. The reason for preferring 2.x to 3.x is that there are some modules out there which haven’t been adapted to the 3.x series yet.

(H)ope (T)his (H)elps :slight_smile:
Ulf