rushabhshah10 / opennero

Automatically exported from code.google.com/p/opennero
Other
0 stars 0 forks source link

cannot find NERO/menu.py #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Running...
 Python: 2.7.2
 wxPython: 2.8 32 unicode for 2.7

I am getting the following error as an infinite loop.

2011-Dec-03 19:46:01.654399 (M) [python] Traceback (most recent call last):
  File "NERO/main.py", line 14, in ModTick
    common.startScript("NERO/menu.py")
  File "C:\Program Files\OpenNERO\common\module.py", line 63, in startScript
    subproc = subprocess.Popen(['python', script])
  File "C:\Program Files\Python\Lib\subprocess.py", line 679, in __init__
    errread, errwrite)
  File "C:\Program Files\Python\Lib\subprocess.py", line 893, in _execute_child
    startupinfo)

I was able to fix the issue by editing the main.py to better match the main.py 
of NERO_Battle 

--------------------------
ORIGINAL
--------------------------
#import all client and server scripts
import NERO.module
import NERO.client
import NERO.agent
import common
import common.menu_utils

def ModMain():
    NERO.client.ClientMain()

script_server = common.menu_utils.GetScriptServer()

def ModTick(dt):
    common.startScript("NERO/menu.py")
    data = script_server.read_data()
    while data:
        NERO.module.parseInput(data.strip())
        data = script_server.read_data()
-----------------------------

--------------------------
MODIFIED
--------------------------
#import all client and server scripts
import NERO.module
import NERO.client
import NERO.agent
import common
import common.menu_utils

script_server = None

def ModMain():
    NERO.client.ClientMain()

def ModTick(dt):
    global script_server
    if script_server is None:
        script_server = common.menu_utils.GetScriptServer()
        common.startScript("NERO/menu.py")
    data = script_server.read_data()
    while data:
        NERO.module.parseInput(data.strip())
        data = script_server.read_data()

Original issue reported on code.google.com by eriktash...@hotmail.com on 4 Dec 2011 at 2:16

GoogleCodeExporter commented 9 years ago
I think this problem is actually due to the program not being able to find the 
python executable. If you add your Python directory to the path, it should be 
OK. I will mark this as duplicate of issue #122

Original comment by ikarpov on 8 Dec 2011 at 2:42