math import problem

hello I have downloaded plenty of scripts but none of
them work because whenever there is a python script error
and the error points to the “from math import *” part and I don’t know
why none of the scripts work.
and I don’t know if it matters what operating system but im on a mac.

and also it points to math import and import os

what os?

do you have python installed?
[is your python path setup]

the math module should exist regardless of installing python, but I think somebody asked a similar question before when they ran osx. I haven’t checked to see what python modules are avalible in osx when you [the user] don’t choose to install python, so I can’t really comment on the problem or the fix [on that platform].

Hi Kid A,

I’m running OSX 10.2.8 and Python 2.2. I had the hardest time getting any script to run, until I added the following 2 lines of code to each script:

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’])

Also be sure your Python path is set (look in the top header bar pull down menu).

One other thing, not all scripts work in all versions of Blender. I tried them all to see which one’s did and which one’s didn’t.

Good Luck.

thanks! but what do I set as my python path?

Hi Kid A,

Well, what I did was, go to Blender file>open. Keep clicking on P in the upper left hand corner until you get to /. Scroll down to usr, click, scroll to lib, click. Now you should be able to see what version of python you have. In my case it’s the one that came with Mac OSX 10.2.8 (python 2.2). This is the path I used, /usr/lib/python2.2/ You can also find your python path using the command line, but I can’t remember off hand what you do.

Hope this helps.

fossileyes,
thanks for the help. now where in the script do I put the lines
of text you gave me?

Hi Kid A,

Both lines right above import Blender, import sys on one line the rest on the second line.