pikasTech / PikaPython

An ultra-lightweight Python interpreter that runs with only 4KB of RAM, zero dependencies. It is ready to use out of the box without any configuration required and easy to extend with C. Similar project: MicroPython, JerryScript.
http://pikapython.com/
MIT License
1.45k stars 132 forks source link

pikaVM_runSingleFile with a error #344

Closed pioneerAlone closed 1 month ago

pioneerAlone commented 1 month ago

Hi ,

I encountered a problem in executing pikaVM_runSingleFile(pikaMain, "test2.py") on windows with mingw ENV. The test2.py file is located in the pikapython directory,

   // run single file
    PikaObj* pikaMain = pikaScriptInit(); // no dependancy, need precompile
    pikaVM_runSingleFile(pikaMain, "test2.py");

Test to run single file with a error below:

here in main.py Assertion "NULL != file_arg" failed, in function: pikaVM_runSingleFile(). (at pikapython\pikascript-core\PikaVM.c:4024) error: execv(E:\Pikapython_demo\build\mingw\x86_64\release\pikapython.exe ) failed(3)

pikasTech commented 1 month ago

The root cause of this issue is that the test2.py file needs to be located in the same directory as the pikapython.exe executable, not in the pikapython directory.

Please ensure that test2.py is placed in the execution path of pikapython.exe. This should resolve the issue of the file not being found.

pioneerAlone commented 1 month ago

Thanks,

It's working now.