Hi, I am still learning the interface of Blender and I am using the OS X version. I am testing python scripts in blender, but non of them have worked so far. I am trying to fix the scripts myself, but I don’t know where the errors are. WHen I run the script, blender just tells me there is an error. While reading the posts here, people say to check the console. I am not able to see any console anywhere. How do I access the python console to see my errors? Thanks in advance.
It’s not a specific Python console that you need. Just run the ‘Console’ program that came with OS X (You’ll find it under Utilities along with Terminal) Python logs its messages and errors to there.
Setanta
What a dumb error, thanks!!!
ok, one more question, how do I fix this error:
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
‘import site’ failed; use -v for traceback
Using a clean Global Dictionary.
In all of the scripts, I am setting the sys path with:
import sys
sys.path.extend([‘’, ‘/usr/lib/python2.2’, ‘/usr/lib/python2.2/plat-darwin’, ‘/usr/lib/python2.2/lib-tk’, ‘/usr/lib/python2.2/lib-dynload’, ‘/usr/lib/python2.2/site-packages’])
That looks like a problem with Python rather than anything else.
You could try re-installing Python or picking up the version from the Fink project.
Setanta
I am using the default python install on mac osx. Is that known to have problems with blender? Which version do you recommend to install?
Here is a basic script I am trying to run:
http://www.blender.org/modules/documentation/228PythonDoc/NMesh-module.html
The errorr I get is:
File “<string>”, line 2
from Blender import NMesh, Material
^
SyntaxError: invalid syntax
‘import site’ failed; use -v for traceback
So, I took out the "from blender …"line, and I still get the import site error.
How can I fix this problem?
I am using Mac OS X with the default python install:
Python 2.2 (#1, 07/14/02, 23:25:09)
[GCC Apple cpp-precomp 6.14] on darwin
Code:
import Blender
from Blender import NMesh, Material
me = NMesh.GetRaw(“Plane”) # get the mesh data called “Plane”
if not me.materials: # if there are no materials …
newmat = Material.New() # create one …
me.materials.append(newmat) # and append it to the mesh’s list of mats
print me.materials # print the list of materials
mat = me.materials[0] # grab the first material in the list
mat.R = 1.0 # redefine its red component
for v in me.verts: # loop the list of vertices
v.co[0] *= 2.5 # multiply the coordinates
v.co[1] *= 5.0
v.co[2] *= 2.5
me.update() # update the real mesh in Blender
install Python 2.3 from Python.org,
Or Get Fink, and type Python and have it install from Bianary ! NOT SOURCE, unless yoou want to wait 6 hours… ^v^ You have to install Python for stuff to work, It is easy and only takes a few click, No terminal needed …
OK, I installed python 2.3 and I get the same error. I installed a binary. Do you guys have any other ideas? I appreciate any help. Thanks.
python 2.3 is a very bad advise because the original blender is compiled with python2.2. Just install only THE compatible python
ok, well I got it working, mac os x COMES withs python 2.2 installed anyway. I had forgotten that python is strict with line placement, so after fixing that, I got most fo the scripts to work. The errors it was rporting don’t really make sense, and in fact it is still giving this error:
‘import site’ failed; use -v for traceback
Thanks for the help.
oopys , I will keep my mouth shut now,