How to import Numpy? --- not possible (it is for C-Python)

Asked by Kurt Zalkowitz

Hi,

I was wondering if it is possible to import installed modules on a running python version in sikuli. I tried the following:

I wrote a file INP.py with following content:

   import numpy
   print("successfully imported!")

and added the path for the file to sikuli:

   sys.path.append("c:/.../python")
   import INP

and got the message: "No module named numpy"

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Kurt Zalkowitz
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

The Numpy Python package can only be used with C-Based Python interpreters (Sikuli uses Jython, which is a Java based interpreter for the Python language (level 2.5)).

For some insight: http://stackoverflow.com/questions/3097466/using-numpy-and-cpython-with-jython

In general Python modules completely written in Python language (e.g. xlrd) or available in a version that is ported to Jython compatibility (like all the standard modules that come with Python 2.5) can be imported, when the folder containing the module is in Sikuli's sys.path.

see docs: http://sikuli.org/docx/globals.html#importing-other-sikuli-scripts-reuse-code-and-images

Revision history for this message
Kurt Zalkowitz (34g18lf3dr10mafs) said :
#2

I see. Thank for the info.