import module bge problem with videogame

Robolad works on my computer but project intelligent racing -A.I.R.I get error in the console



Read new prefs: C:\Users\barbara\AppData\Roaming\Blender Foundation\Blender\2.72\config\userpref.blendfound bundled python: C:\Program Files\Blender Foundation\Blender\2.72\pythonread blend: C:\Users\barbara\Desktop\Blender Racing 0.04.blendTraceback (most recent call last):  File "C:\Users\barbara\Desktop\Blender Racing 0.04.blend\carControll.py", line 1, in ImportError: No module named 'bge'

I’m guessing you haven’t changed any of the code. Are you using the latest version of Blender?

I have not changed any of the code.I am using 2.72b.

Sounds a bit as the code is running as Blender script rather than via Python controller.

But how can that happen?I downloaded the game from this websight.It happened on another game as well.

The car game from tutorials for blender 3d and the blender 3d game engine.It crashes the bge when i press p.The computer i am on has windows 8.1.

Could it be that your Blender-installation is missing something?

Try this code with the default cube:


import bge

print("if you see me, the module bge was imported:", bge)

This is what say’s.I have python installed.

Read new prefs: C:\Users\barbara\AppData\Roaming\Blender Foundation\Blender\2.72
\config\userpref.blend
found bundled python: C:\Program Files\Blender Foundation\Blender\2.72\python
Detected GL_ARB_texture_env_combine
Detected GL_ARB_texture_cube_map
Detected GL_ARB_multitexture
Detected GL_ARB_shader_objects
Detected GL_ARB_vertex_shader
Detected GL_ARB_fragment_shader
Detected GL_ARB_vertex_program
Detected GL_ARB_depth_texture
Detected GL_EXT_separate_specular_color
Blender Game Engine Started
if you see me, the module bge was imported: <module 'bge'>

So it is not your installation, otherwise this would not show up.

Where did you get the game from? I would like to check if it works for me.

I will check that when I’m home.

This is the error you get when you try running a script in the editor, going to the script window and hitting “Run Script” on a block of text.

You’re getting this error because that is used for blender-editor scripts, which use the bpy module, not bge.

You shouldn’t have to “Run” any of the scripts to play the game, just hit p to play.

Blender game engine crashes shorty after when i type hit p.It will actually exit the blend file for games made in python that have cars in them.

The game crashes my whole system if I try to play it in textured mode. Works in wireframe mode though.

Also, all the textures seem to be missing, or only showing their base diffuse color, and the sound is seriously messed up.

More than likely, this game is broken. Leave a comment in the thread you got the game from, and Try Another Game.

I already left a comment.He said i was having problems importing the blender game engine library.And it does not work in wireframe for me.

I looked at the file from the above link. It looks like it is prepared for MacOS (I’m on Win8).

As there is a blend inside the zip I opened that one. It is missing the textures as stated above and some sound files. Nevertheless it works for me. I can see some cars in a violet environment.

I could not see the ImportError. This might be something MacOS specific and just in that game. I can’t tell sorry.

Could you try the blend with the car in it on the websight Blender 3d and Game Engine Tutorials?I would like to know if it is just my blendergame engine.Common monster there has to be something that can be done.Other people are having problems like this to.If you read the other posts you will get what i mean.

The only thing that I know about this error message is when a bge script runs as Blender script ( text editor -> run script).

From your description I guess you run the game application file rather then opening it in Blender. If my guess is incorrect there might be some auto-run on a script that causes the error message. Nevertheless it should not matter if Blender aborts the bge script as it should run in the BGE not Blender.

Beside of that the BGE outputs a startup message and a closing message to the console. Something I miss in your first post. So I can only guess this is a problem of your userpreferences.

That was not the problem.
Could this be causing the problem?

Could this be causing the problem?
Read new prefs: C:\Users\barbara\AppData\Roaming\Blender Foundation\Blender\2.73
\config\userpref.blend
found bundled python: C:\Program Files\Blender Foundation\Blender\2.73\python
fake_module: addon missing 'bl_info' gives bad performance!: 'C:\\Users\\Barbara
 Foundation\\Blender\\2.73\\scripts\\addons\\riggener
ator.py'
Imported multifiles