Not Able to import PIL in Sikuli

妖精的绣舞 提交于 2019-12-02 00:54:12

The Sikuli IDE uses Jython so packages installed to your local Python version won't be able to be imported within the Sikuli IDE and Jython doesn't support c extensions as far I'm aware which PIL requires ( see http://bugs.jython.org/issue1388 ).

I think you would need to use a Java library, maybe something like ImageJ ( see http://fiji.sc/wiki/index.php/Jython_Scripting )

Since the following (as I think valuable information) was rejected as an edit to the original question (my intention: people should see this in the first place), I put it as an answer now:

I want to add: Python modules can be imported in Jython/Sikuli scripts as long as they contain only Python code. There are many modules written for Python, that hold this condition (e.g. xlrd, xlwt). But as correctly mentioned: PIL contains C-based stuff and this can normally (exception JNI libs) not be loaded (hence the above error message, which is true, but might lead in the wrong direction).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!