Import Error: No module named 'bge' #41522

Closed
opened 2014-08-21 05:18:09 +02:00 by Elisha · 11 comments

Hi i am 13 and have been programming in python since 12 in a half and now working on C# for developing games and webpages. I have used Blender since January. About 3 months ago I started working on my horror game with blender and python. Now I only got 20% of the game created or built. But there is much more for the game before it is nearly finished. Now I am working with Blender's Game Engine trying to import module "bge". For some reason I get this error, "ImportError: No module named 'bge'. Sounds like something went wrong.with Blender.

I used to use blender 2.70, but I am now using the newest version blender 2.71. Anyway is there anyway I or others can fix this problem?

Hi i am 13 and have been programming in python since 12 in a half and now working on C# for developing games and webpages. I have used Blender since January. About 3 months ago I started working on my horror game with blender and python. Now I only got 20% of the game created or built. But there is much more for the game before it is nearly finished. Now I am working with Blender's Game Engine trying to import module "bge". For some reason I get this error, "ImportError: No module named 'bge'. Sounds like something went wrong.with Blender. I used to use blender 2.70, but I am now using the newest version blender 2.71. Anyway is there anyway I or others can fix this problem?
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @ElijahCampbell

Added subscriber: @ElijahCampbell

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Dalai Felinto self-assigned this 2014-08-21 11:18:21 +02:00

This is not a bug. The bge module only works inside the Blender Game Engine (so it needs to be called from a Python Controller). Not from a Text Editor. For more info: wiki, books, ... ;) closing the report now

This is not a bug. The bge module only works inside the Blender Game Engine (so it needs to be called from a Python Controller). Not from a Text Editor. For more info: wiki, books, ... ;) closing the report now
Member

Added subscriber: @zanqdo

Added subscriber: @zanqdo
Member

Hi @ElijahCampbell I've found a little tutorial that I hope helps you understand how to use python in the Blender GE

http://solarlune-gameup.blogspot.com/2011/01/using-python-in-blender-game-engine.html

best of luck

Hi @ElijahCampbell I've found a little tutorial that I hope helps you understand how to use python in the Blender GE http://solarlune-gameup.blogspot.com/2011/01/using-python-in-blender-game-engine.html best of luck
Author

Sorry all :(

Sorry all :(
Author

Didn't know it "bge" does not have to be imported no more.

Didn't know it "bge" does not have to be imported no more.

@ElijahCampbell it doesn't need to be imported indeed. But the script still needs to run from within the BGE for it to work ;) No need to be sorry, this is a classic mistake. I recommend searching for existent bugs before reporting one in the future though. Good luck in your project.

@ElijahCampbell it doesn't need to be imported indeed. But the script still needs to run from within the BGE for it to work ;) No need to be sorry, this is a classic mistake. I recommend searching for existent bugs before reporting one in the future though. Good luck in your project.

Added subscriber: @MarcClintDion

Added subscriber: @MarcClintDion

(I must have hit a weird font button)

GraphicPro7, I wouldn't feel too bad about this. Because of your age and what you are doing, you've already been mentioned on the #blendercoders IRC channel, Twitter and now Blender Adventures also just reposted the Twitter thing. You're a minor celebrity now.

"Pablo Vazquez ‏@PabloVazquez_ 22h

This dude born in 2001 is already making games with open source, and submitting bug reports: https://developer.blender.org/T41522 #awesome #b3d "

https://plus.google.com/+AdventuresInBlender/posts

In the future, you can try asking people on http://blender.stackexchange.com/ if you are having problems with things, usually most questions are answered very quickly and it will help you to have extra opinions on whether or not to file here on the tracker.

(I must have hit a weird font button) GraphicPro7, I wouldn't feel too bad about this. Because of your age and what you are doing, you've already been mentioned on the #blendercoders IRC channel, Twitter and now Blender Adventures also just reposted the Twitter thing. You're a minor celebrity now. ----------------------------------------------------------------------------------------------------------------- "Pablo Vazquez ‏@PabloVazquez_ 22h This dude born in 2001 is already making games with open source, and submitting bug reports: https://developer.blender.org/T41522 #awesome #b3d " ----------------------------------------------------------------------------------------------------------------- https://plus.google.com/+AdventuresInBlender/posts ----------------------------------------------------------------------------------------------------------------- In the future, you can try asking people on http://blender.stackexchange.com/ if you are having problems with things, usually most questions are answered very quickly and it will help you to have extra opinions on whether or not to file here on the tracker.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#41522
No description provided.