PyCharm: Debugging a script: [error] Image: Image not valid --- set imagepath

Asked by stefano on 2018-02-21

Hello,

I'm trying to run and debug a sikulix script under pycharm. I've got a working sikulix debug configuration: the application to be tested is opening and starting correctly with App.open, then it seems to detach from the debug process with the following message in the log area...

[log] App.open [14544:myAppToBeTested]
[error] Image: Image not valid, but TextSearch is switched off!
[error] RunTimeAPI: Wait: Abort: Jython traceback - current first:
Sikuli (65)
event_app1 (57)
event_app1 (128)
pydevd (1072)
pydevd (1662)
pydevd (1668)
[error] RunTimeAPI: ImageMissing: 1438252894773.png

Process finished with exit code 137 (interrupted by signal 9: SIGKILL)

If I put a breakpoint in pycharm, target code is never reached.
I'm using sikulix 1.1.1 , jython 2.7 and the latest pyCharm and the same script is working OK under standard sikulix Ide

Regards,
Stefano

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2018-02-23
Last query:
2018-02-23
Last reply:
2018-02-21
Best RaiMan (raimund-hocke) said : #1

when you run a script in PyCharm (which is the same as if running it with plain Jython) you have to say, where the images are.
This is because in PyCharm you run the myScript.py directly, where as in the IDE it is the myScript.sikuli, which is opened and run, having the knowledge about the bundle path.

see:
http://sikulix-2014.readthedocs.io/en/latest/scripting.html#importing-other-sikuli-scripts-reuse-code-and-images

... and be aware of
https://github.com/RaiMan/SikuliX-2014/wiki/Jython-in-IDEs-like-Eclipse-or-running-it-from-commandline

stefano (stefano-perticoni) said : #2

Problem solved, thank you very much!

stefano (stefano-perticoni) said : #3

Thanks RaiMan, that solved my question.