My game runs in Blender, but not as exported .exe

I have just started using the game engine, so please excuse me if I’ve missed something fundamental

I have a script running that controls a cube. I’m reading a few values (over UDP) and sets cube position and rotation according to these values. This works perfectly in Blender, but when I export - nothing moves whatsoever. There is a message quickly flashed before the exe runs, saying:
Color management: using fallback mode for management
BLF_lang_init: ‘locale’ data path for translations not found, continuing
.

I have tried Blender 2.72, 2.73 and 2.74. I have also tried separately installing Python. Nothing works so far.

This is the script I am running:

import bpy, bge, socket, struct, math

def main():
    # Setup objects
    cont = bge.logic.getCurrentController()
    player = cont.owner

    if not 'init' in player:
        player['init'] = 1
        # open network socket
        port = 20001
        player['socket'] = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        player['socket'].bind(("127.0.0.1", port))
        print("Run
")
        player['socket'].settimeout(.04) # Caught in exception to not lock program
    
    schene = bge.logic.getCurrentScene
    try:
        data, addr = player['socket'].recvfrom(16) # 'bufsize' bytes
        if data:
            unp = struct.unpack('!2d', data)
            player.localPosition.z = unp[1]    
            player.localOrientation = (0, 0, unp[0])
        else:
            print('no data')
    except socket.timeout:
        print('')
main()

Hi! bpy module “works” only with embedded player. It’s not included in standalone or exported as exe games. You can look at your console in standalone (no module named bpy). However, it’s not recommended to use bpy in the game engine…

Hey wow, that totally solved it! The warnings are still there, but at least it works!
So i simply removed the import bpy (since Im not even using it. I must have left it there while trying everything) and now it does what I want.

Thanks!