locating modules


(d52477001) #1

hi,
i’m new to this whole blender python business and i have a few questions.

firstly i have a very common problem when running scripts and that is that i get an error message that a module is not found (in the dos window). There are two in particular: random and dynoise. Are these reffering to the .dll? i have the .dll in the same folder as the script so is there any special place i should put it?

secondly is that i have python 2.2.1 but i heard that a lot of people also have older versions because some scripts don’t work with new versions of python. Is this true? if so, what is the best older version to have?

Thanks a lot!

Djurre.


(scorpius) #2

You have two options:

  1. Put modules and dlls in the directory where your blender exe is located.
  2. Add the directory where modules and dlls are located to the PYTHONPATH environmental variable.

Here is what I use:
set pythonpath=d:\Python\DLLs;d:\Python\Lib;d:\python\pil;.;e:\blender\python;

See the period between semicolons? It adds the current directory to the module search path.


(theeth) #3

it doesn’t matter where the DLLs / modules are, as long as your PYTHONPATH points to them.

Remember, you also have to define the path in the Info window (pull the top window where the menus are).

Martin


(d52477001) #4
  1. Add the directory where modules and dlls are located to the PYTHONPATH environmental variable.

where exactly can i find this pythonpath environmental variable?


(d52477001) #5

and whatr about if the module is not included? eg i got the ter2blend script and i need a module named ‘os’ but it is not included in the zip file.


(RipSting) #6

The module “os” is included with the python 2.0.1 installation.

Look for my post in this topic to find how to set environment variables in windows 2k/xp

http://www.elysiun.com/viewtopic.php?t=3563&highlight=set+environment+variables


(d52477001) #7

brilliant! there are so many new possibilities 8) …

thanks a lot :smiley: