ImportError: cannot import name fileSystemDecode

Asked by Wei on 2020-03-05

Hello :)

I am using Sikuli for a UI automation of a windows application. When I created the script and started to run it, I found sikuli will create folder in "Roaming" which contains all libs, and when sikuli init, there will be an import error in subprocess.py, below is the log, my workmate running the script without any error on his laptop, but we are using the same setup, same jython, same python, same JRD, same version of sikuli.

    from sikuli import *
  File "C:\Users\wgong\AppData\Roaming\Sikulix\Lib\sikuli\__init__.py", line 6, in <module>
    from Sikuli import *
  File "C:\Users\wgong\AppData\Roaming\Sikulix\Lib\sikuli\Sikuli.py", line 20, in <module>
    import subprocess
  File "C:\Users\wgong\AppData\Roaming\Sikulix\Lib\subprocess.py", line 441, in <module>
    from org.python.core.Py import fileSystemDecode
ImportError: cannot import name fileSystemDecode

My laptop environment:
WIndow 10 64bit
Python 2.7.10
Jython 2. 7.0
Sikyli 2.0.3
Java 1.8.0_161

Thanks so much if you could take a look at this issue ,cheers.

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
Wei
Solved:
2020-03-06
Last query:
2020-03-06
Last reply:
2020-03-05
RaiMan (raimund-hocke) said : #1

please put

import sys
for e in sys.path: print e

... and paste the output here

before the
from sikuli import *

(which is not needed BTW in a main script)

Wei (wgong) said : #2

HI RaiMan,

Thanks for the reply, here I got the output:

C:\Working_P4\depot\qa\tests\licensing\Corti\tuningtool\DAX3.5.6\automation-test
C:\jython2.7.0\Lib
__classpath__
__pyclasspath__/
C:\jython2.7.0\Lib\site-packages
C:\Working_P4\depot\qa\tests\licensing\Corti\tuningtool\DAX3.5.6\automation-test\case\two_speakers

Wei (wgong) said : #3

Hi RaiMan,

Sorry, here is the log of putting the script after import org.sikuli.script.SikulixForJython

C:\Users\wgong\AppData\Roaming\Sikulix\Lib\site-packages
C:\Users\wgong\AppData\Roaming\Sikulix\Lib
C:\Working_P4\depot\qa\tests\licensing\Corti\tuningtool\DAX3.5.6\automation-test
C:\jython2.7.0\Lib
__classpath__
__pyclasspath__/
C:\jython2.7.0\Lib\site-packages
C:\Working_P4\depot\qa\tests\licensing\Corti\tuningtool\DAX3.5.6\automation-test\case\two_speakers

Wei (wgong) said : #4

Hi RaiMan,

Thanks for indicating the direction, I found that I had wrong sikuli jar in classpath, I should set sikulixapi-2.0.3.jar instead of sikulix-2.0.3.jar. After update claspath , delete the sikuli folder in Roaming. The error no longer exists.

Thanks for your help.

RaiMan (raimund-hocke) said : #5

... and you should use Jython 2.7.1

Wei (wgong) said : #6

Thanks, I will update it too.