problem with showing data from simulation (exe files)

I had a problem with serial communication
software used:

  • Blender 2.67 (Game Simulation)
  • virtual serial port
  • TeraTerm (Show output data)

When I play the simulation from Blender, the data transmitted from Blender were accepted in TeraTerm (data will appear in TeraTerm)
But when I make it into exe, the data does not appear again in TeraTerm.

Library already exported into the exe folder.
anyone know what is the problem?

What are you trying to achieve overall?
How did you do it?
How are you creating a virtual serial port? Or is it just a usb -> serial adapter

What libraries are you using in python? What blender ones?
Are external libraries being found? (relative/absolute path problems? Are they in the same directory as the blends?)

Is another program using the serial port?
Is anything displayed in the game engine console? Consider adding some debug statements to find out what’s happening.

Just some questions that may or may not help uncover the problem

I make flight simulation and controlling by joystick
and I make script for serial communication for that
I use Virtual Serial Port for make virtual COM3 and COM4, for communication between Blender and TeraTerm
data sent from blender will received by TeraTerm.
I use library serial for the communication
here the script I use for it

import serial
import bge
ser = serial.Serial("COM3", 9600)
cont = bge.logic.getCurrentController()


joyup = cont.sensors["up"]
joydown = cont.sensors["down"]
joyleft = cont.sensors["left"]
joyright = cont.sensors["right"]


if joyup.positive:
    up=ser.write('up,'.encode("ascii"))
    print(up)
    
elif joydown.positive:
    down=ser.write('dw,'.encode("ascii"))
    print(down)
    
elif joyleft.positive:
    left=ser.write('l,'.encode("ascii"))
    print(left)
    
elif joyright.positive:
    right=ser.write('r,'.encode("ascii"))
    print(right)
    
ser.close() 

After I make virtual port, I open Teraterm to see the data will recived
When I pres “P” in Blender and i move joystick, data will appear in TeraTerm

exe folder:


the problem is, when I export it into exe files
Data sent was not seen again on TeraTerm
Serial library already in exe folder
Library in exe folder:

data not show up in Teraterm after export to exe files makes me so confused
I also try from stand alone mode,
in toggle system console it said “No module named ‘serial’”


anyone know how to fix it?