standalone .exe can't find blender module

I’m using 2.43 and i have a game all packed and ready to go, so i saved the runtime (not dynamic), but when i try to run it, it can’t find the blender module, because i tried to import it:

from Blender import * etc

where is it? is it even on the computer or built in? will i be able to make my exe at all?

Did you include the .dll’s from the Blender directory in the same directory as your runtime?

i put the runtime in the Blender directory where all the dlls, blender.exe, and the blender player are and it said

No module named Blender

Sounds like a coding error. Running through the basics, does your uncompiled Blend play correctly?

Actually looking as your post, the mistake’s easy to notice, there’s no module named ‘Blender’, so you can’t import any logic from it. You’ll have to remove all references of it from your code.

Should have spotted that before my first post, one of those kind of days :wink:

The Blender module exists, but the game engine can’t use it.

True enough. I meant no module usable.

You need to create the blender module, just a simple python file with:

import Blender

Then stick the module in the same folder as the .exe

you can use the Blender module in the GE! in a .blend you can anyway…

The Blender module is available in Blender, so when you run a game from Blender it works. However, it is not included in the blenderplayer, so it does not work there. If you can find a copy of the module somewhere and include it in the same directory as your game, it will (read “should”) work. I’ve never looked for it before, so I’m not sure where it’s hiding. I think I’ll dig around a little for it.

okay i answered my own question! i just googled blender.py, mathutils.py, and gamelogic.py and found them all easily! but there were problems: blender.py did not have attribute named mathutils; and i couldn’t find math.py, which i also need.

First…just like to introduce myself :slight_smile: So hey everyone! I’m a blender n00b and pretty new to 3D modeling as well. I’ve been running all the tut’s from the blender wiki, and being working about everynight for a few hours, for the past few weeks.

I’m trying to make an .exe out of one of the tut’s (where you make the sphere on a plane, and roll it around…knocking stuff off…etc). I’ve done nothing in python, just strictly what the tut said (which involved no code writing). I did add a few extra cubes and such…but nothing major at all.

I saved the runtime to a folder, and copied all the dll’s in the blender folder to the same directory. When I run the exe, the Blender view window opens, but stays blank. The “dos” window repeats “warning btCollisionDispatcher::needsCollision: static-static collision!” , and keeps repeating it until you close the window. That’s all I get.

I’m using Blender 2.44 and Python 2.5

Any help would be greatly appreciated!

Thanks a bunch, and I hope to actually be able to contribute to this forum soon instead of just gleen info :wink:

Emos

well i think if you installed Python 2.5 like i did, you really are running 2.4 that comes with blender. ive seen that error before but nothing happened and my program ran fine

Hmm…well I un-installed Python 2.5 real quick, just to see what would happen when trying to run in then, but nothing changed…same results.