These are chat archives for evhub/coconut

Jun 2017
José Carlos Micó
Jun 04 2017 11:55
Hi all! I'm doing an app (like a plugin) for a game and I've to import sys module. When coconut source file is compiled to python, it generates this code line: "import sys as _coconut_sys" and it generates an error when my app is loaded by the game, because there's an "ERROR LOADING MODULE : sys.path.append('apps/python/myapp')", myapp is where file is located. If I put the same python/coconut code without being compiled by coconut it works.
Jun 04 2017 14:08

I don't see this happening in a quick test here

import sys

in a .coco file gets compiled to a .py file unchanged (1.2.0 [Colonel] running on Python 3.6.1)

José Carlos Micó
Jun 04 2017 14:17
@yggdr Thanks for your reply
The game has its own python console, when it tries to start my app it generates this error: "ERROR LOADING MODULE : sys.path.append('apps/python/myapp')"
If I put the same code without being compiled by coconut, it works.
This is the code
import sys
# game libraries
import ac
import acsys

def acMain(ac_version):
    # app code
José Carlos Micó
Jun 04 2017 14:39
Python game version is 3.3.5
I tried your code and it works, but in python console, not in-game console
[SOLVED] Adding --target 3.3 solved the problem.