How do you setup the python library path for blender?

Hi guys,

I’m having some trouble setting up the python library path for blender. My python library is installed in /usr/lib/python2.4, and I have to copy all my scripts that I need to import into /usr/lib/python2.4/site-packages for blender to be able to import them. Is there anyway to make blender look for the imported scripts in the ‘.’ direction by default?

Also, blender (python2.4 version) cannot seem to be able to import any of the shared libraries in the /usr/lib/python2.4/lib-dynload directory. For example, when I try the following code:


import operator

I get the error:


ImportError: /usr/lib/python2.4/lib-dynload/operator.so: undefined symbol: _PyArg_NoKeywords

The operator module is always included in the standard python distribution, I don’t understand why blender should have a problem with it, and I suspect it’s because /usr/lib/python2.4/lib-dynload/operator.so is linked to some other shared library whose path blender doesn’t know about.

Any help would be greatly appreciated.

Thanks a lot for reading

-D

never mind about the problem of blender not looking for python modules in “.”, I included . in PYTHONPATH and it works now.

However, I still haven’t figured out why blender cannot import standard python modules such as operator and iterator, any ideas?

Works for me, strange.

What are paths in: Help-> System -> system information ?

It does? Interesting, I’ve so far tried to import operator on two of my computers and have had the same problem. Both computers of mine are running ubuntu 6.06 and blender 2.42 with python 2.4.

I did try Help-> System -> system and blender says to look for the info in system-info.txt which it just created … except that I cannot find this file in either my current directory, or /tmp, or .blender/ … how strange?

Thanks a lot for the reply though.

-D

Oop, sorry! I get that same error when I run Blender 2.4 but with 2.4-cvs it works. So maybe there is something wrong in Blender …

You can find that .txt from Blender’s text-editor by selecting it from that menu from bottom. Yes, it is a littlebit strange place :slight_smile:

ah, so it wasn’t just me, :smiley: i feel much better now, hopefully they’ll fix it in the next release. but inccidentally, who should we notify about this problem?

sorry, which menu from bottom? :confused:

It seems to work with current cvs so grab a build or build yourself: http://mediawiki.blender.org/index.php/BlenderDev/UbuntuBlenderCompile

sorry, which menu from bottom? :confused:

Right there:
http://opendimension.org/blender/images/systeminfo.png