Sikuli can't import YAML module?

Asked by Milteven on 2016-12-26

Hello, I'm using the Sikuli IDE and trying to import a module named yaml but the console shows this error:

[error] script [ OCReConversorDeString ] stopped with error in line 1
[error] ImportError ( No module named yaml )

"yaml" is in the list of modules on python shell, I'm not a programmer, so maybe I am doing something wrong, this is the script i'm trying to run:

import yaml
Settings.OcrTextRead = True

reg = selectRegion()
print reg.text()

Thank you for your attention, have a good day!

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Best RaiMan (raimund-hocke) said : #1

For SikuliX scripts you can use the Python scripting language (level 2.7), but internally as interpreter we use the Java based Jython.

Modules available for Python (C based Python) are only uaseable, if they are completely written in Python language (no C-based or even native code based parts).

Since Python YAML ( relies on a C-based library, it cannot be used as is in SikuliX.

You might try this solution:

on Windows you have to download the zipped source from, unzip it and run the setup as mentioned.

To run jython from a commandline use:
java -cp <path-to>/sikulix.jar org.python.util.jython ...

Milteven (milteven12) said : #2

Thanks RaiMan, that solved my question.