Not able to install sikulix 1.1.4 version in my Ubuntu16.04.5 machine in Azure

Asked by Punitha on 2018-11-01

I am using Ubuntu version 16.04.5 in Microsoft Azure environment. Please find the below details:
root@scb-test-7:/home/SikuliX# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial

Mine is a 64-bit system

Java version:
root@scb-test-7:/home/SikuliX# /home/SikuliX/jdk-11.0.1/bin/java -version
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)

I have created SikuliX folder in /home/
root@scb-test-7:/home/SikuliX# pwd
/home/SikuliX

Initially I have placed the files required to install sikuli 1.1.4 version. Please see the details below:
root@scb-test-7:/home/SikuliX# ls
jdk-11.0.1
jython-standalone-2.7.1.jar
openjdk-11.0.1_linux-x64_bin.tar.gz
sikulixapi.jar
sikulix.jar

I have followed the below commands to install the sikulix.jar:
/home/SikuliX/jdk-11.0.1/bin/java -jar sikulix.jar -v

Here in this installation I have received the error "X11 DISPLAY variable was set".

Please find the installation log and the error:
root@scb-test-7:/home/SikuliX# /home/SikuliX/jdk-11.0.1/bin/java -jar sikulix.jar -v

[DEBUG] RunIDE: Running: /home/SikuliX/sikulix.jar
[DEBUG] RunIDE: AppData: /root/.Sikulix
[DEBUG] RunIDE: starting
[DEBUG] RunIDE: looking for extension jars in: /root/.Sikulix/Extensions
[DEBUG] RunIDE: adding extension: /root/.Sikulix/Extensions/jython-standalone-2. 7.1.jar
[180 debug] Sikulix: starting IDE
[193 debug] RunTimeINIT: starting IDE
[200 debug] RunTimeINIT: java version
[200 debug] RunTimeINIT: user.home
[200 debug] RunTimeINIT: user.dir
[201 debug] RunTimeINIT: app data path
[201 debug] RunTimeINIT: store debug.txt
[201 debug] RunTimeINIT: loadOptions: check: /home/SikuliX
[202 debug] RunTimeINIT: loadOptions: check: /root
[202 debug] RunTimeINIT: loadOptions: check: /root/.Sikulix/SikulixStore
[204 debug] RunTimeINIT: version: 1.1.4-SNAPSHOT build: 2018-10-30_14:49
[205 debug] RunTimeINIT: global init: entering as: IDE
[259 debug] RunTimeINIT: running in headless environment
[281 debug] RunTimeINIT: runs as sikulix.jar in: /home/SikuliX
***** show environment for 1.1.4-SNAPSHOT-2018-10-30_14:49 IDE
user.home: /root
user.dir (work dir): /home/SikuliX
user.name: root
java.io.tmpdir: /tmp
running 64Bit(amd64) on Linux (4.15.0-1025-azure) from a jar
java 8 version 1.8 vm 25.181-b13 class 52.0 arch 64
app data folder: /root/.Sikulix
executing jar: /home/SikuliX/sikulix.jar
*** classpath dump sikulix
  0: file:/home/SikuliX/sikulix.jar
  1: file:/root/.Sikulix/Extensions/jython-standalone-2.7.1.jar
*** classpath dump end
***** show environment end
[284 debug] RunTimeIDE: global init: leaving
[284 debug] RunTimeIDE: initIDEbefore: entering
[285 debug] RunTimeIDE: initIDEbefore: leaving
[285 debug] RunTimeIDE: initAPI: entering
[285 debug] RunTimeIDE: resourceLocation: (class org.sikuli.ide.SikuliIDE) /Lib/ sikuli
[290 debug] RunTimeIDE: resourceList: having jar: jar:file:/home/SikuliX/sikulix .jar!/Lib/sikuli
[2062 debug] RunTimeIDE: files exported: 7 from: Lib/sikuli to:
 /root/.Sikulix/Lib/sikuli
[2062 debug] RunTimeIDE: initAPI: leaving
[2062 debug] RunTimeIDE: initIDEafter: entering
[2062 debug] RunTimeIDE: initIDEafter: leaving
Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
        at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
        at java.awt.Window.<init>(Window.java:536)
        at java.awt.Frame.<init>(Frame.java:420)
        at javax.swing.JFrame.<init>(JFrame.java:233)
        at org.sikuli.ide.SikuliIDE.<init>(SikuliIDE.java:148)
        at org.sikuli.ide.SikuliIDE.getInstance(SikuliIDE.java:153)
        at org.sikuli.ide.SikuliIDE.run(SikuliIDE.java:182)
        at org.sikuli.ide.SikulixRunIDE.main(SikulixRunIDE.java:38)
[2076 debug] RunTimeIDE: final cleanup
[2078 debug] FileManager: deleteFileOrFolder:
/tmp/Sikulix_1282914322
[DEBUG] RunIDE: terminating: returned: 1

To resolve the X11 DISPLAY variable requirement I have given the command "export DISPLAY=:1" prior to "/home/SikuliX/jdk-11.0.1/bin/java -jar sikulix.jar -v" as below:
root@scb-test-7:/home/SikuliX# export DISPLAY=:1
root@scb-test-7:/home/SikuliX# /home/SikuliX/jdk-11.0.1/bin/java -jar sikulix.jar -v

Now, am facing a _thread import error. Please find the below log statements and _thread import error.

[DEBUG] RunIDE: Running: /home/SikuliX/sikulix.jar
[DEBUG] RunIDE: AppData: /root/.Sikulix
[DEBUG] RunIDE: starting
[DEBUG] RunIDE: looking for extension jars in: /root/.Sikulix/Extensions
[DEBUG] RunIDE: adding extension: /root/.Sikulix/Extensions/jython-standalone-2.7.1.jar
[160 debug] Sikulix: starting IDE
[172 debug] RunTimeINIT: starting IDE
[178 debug] RunTimeINIT: java version
[179 debug] RunTimeINIT: user.home
[179 debug] RunTimeINIT: user.dir
[179 debug] RunTimeINIT: app data path
[179 debug] RunTimeINIT: store debug.txt
[180 debug] RunTimeINIT: loadOptions: check: /home/SikuliX
[180 debug] RunTimeINIT: loadOptions: check: /root
[180 debug] RunTimeINIT: loadOptions: check: /root/.Sikulix/SikulixStore
[182 debug] RunTimeINIT: version: 1.1.4-SNAPSHOT build: 2018-10-30_14:49
[183 debug] RunTimeINIT: global init: entering as: IDE
[243 debug] RunTimeINIT: Accessing: GraphicsEnvironment.getLocalGraphicsEnvironment()
[253 debug] RunTimeINIT: Accessing: GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()
[263 debug] RunTimeINIT: ScreenDevice 0 has (0,0) --- will be primary Screen(0)
[264 debug] RunTimeINIT: Monitor 0: (0, 0) 1024 x 768
[285 debug] RunTimeINIT: runs as sikulix.jar in: /home/SikuliX
***** show environment for 1.1.4-SNAPSHOT-2018-10-30_14:49 IDE
user.home: /root
user.dir (work dir): /home/SikuliX
user.name: root
java.io.tmpdir: /tmp
running 64Bit(amd64) on Linux (4.15.0-1025-azure) from a jar
java 8 version 1.8 vm 25.181-b13 class 52.0 arch 64
app data folder: /root/.Sikulix
executing jar: /home/SikuliX/sikulix.jar
*** classpath dump sikulix
  0: file:/home/SikuliX/sikulix.jar
  1: file:/root/.Sikulix/Extensions/jython-standalone-2.7.1.jar
*** classpath dump end
***** show environment end
[288 debug] RunTimeIDE: global init: leaving
[288 debug] RunTimeIDE: initIDEbefore: entering
[288 debug] RunTimeIDE: initIDEbefore: leaving
[289 debug] RunTimeIDE: initAPI: entering
[289 debug] RunTimeIDE: resourceLocation: (class org.sikuli.ide.SikuliIDE) /Lib/sikuli
[292 debug] RunTimeIDE: resourceList: having jar: jar:file:/home/SikuliX/sikulix.jar!/Lib/sikuli
[2035 debug] RunTimeIDE: files exported: 7 from: Lib/sikuli to:
 /root/.Sikulix/Lib/sikuli
[2035 debug] RunTimeIDE: initAPI: leaving
[2036 debug] RunTimeIDE: initIDEafter: entering
[2036 debug] RunTimeIDE: initIDEafter: leaving
[2096 debug] init user preferences
[2121 debug] IDE: running with Locale: en_US
[2121 debug] --- Sikuli parameters ---
[2121 debug] 1: -v
[2123 debug] RunTimeIDE: exists libs folder at: /root/.Sikulix/SikulixLibs
[2124 debug] RunTimeIDE: resourceLocation: (class org.sikuli.ide.SikuliIDE) /sikulixlibs/linux/libs64
[2125 debug] RunTimeIDE: resourceList: having jar: jar:file:/home/SikuliX/sikulix.jar!/sikulixlibs/linux/libs64
[3856 debug] RunTimeIDE: loadLib: libJXGrabKey.so
[3857 debug] HotkeyManager: add Capture Hotkey: CTRL+SHIFT 2 (50, 3)
[3860 debug] HotkeyManager: add Abort Hotkey: ALT+SHIFT C (67, 9)
[3860 debug] IDE: Init ScriptingSupport
[3862 debug] ScriptingSupport: initScriptingSupport: enter
[6126 debug] JythonSupport: init: starting
[6127 debug] JythonSupport: init: success
[6129 debug] JythonSupport: added as Jython::sys.path[0]:
/root/.Sikulix/Lib/site-packages
[6130 debug] JythonSupport: ***** Jython sys.path
 0: /root/.Sikulix/Lib/site-packages
 1: /root/.Sikulix/Lib
 2: /root/.Sikulix/Extensions/Lib
 3: /root/.Sikulix/Extensions/jython-standalone-2.7.1.jar/Lib
 4: __classpath__
 5: __pyclasspath__/
[6131 debug] JythonSupport: ***** Jython sys.path end
[6236 debug] Jython: sikuli: Sikuli: starting init
[error] RunTimeIDE: *** terminating: JythonScriptRunner: cannot be initialized:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/root/.Sikulix/Lib/sikuli/__init__.py", line 4, in <module>
    from Sikuli import *
  File "/root/.Sikulix/Lib/sikuli/Sikuli.py", line 19, in <module>
    import subprocess
  File "/root/.Sikulix/Lib/subprocess.py", line 400, in <module>
    import threading
  File "/root/.Sikulix/Lib/threading.py", line 10, in <module>
    from _threading import Lock, RLock, Condition, _Lock, _RLock, _threads, _active, _jthread_to_pythread, _register_thread, _unregister_thread
ImportError: cannot import name _threads

[6544 debug] RunTimeIDE: final cleanup
[6546 debug] FileManager: deleteFileOrFolder:
/tmp/Sikulix_254383229
[DEBUG] RunIDE: terminating: returned: 1

Kindly help to resolve the above import error "cannot import name _threads" to complete the installation of Sikulix setup version 1.1.4 in ubuntu16.04.5 in Azure.

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2018-11-02
Last reply:
2018-11-02
RaiMan (raimund-hocke) said : #1

should be a question

RaiMan (raimund-hocke) said : #2

Did you upload the Jython pack from the SikuliX Download page as mentioned there?

RaiMan (raimund-hocke) said : #3

 AppData: /root/.Sikulix

... not sure, why this is /root/ and not/ home/

Punitha (punithap) said : #4

Yes, I have uploaded the jython pack "jython-standalone-2.7.1.jar" from the sikulix download page as metioned.

Punitha (punithap) said : #5

AFter running the below command, .SikuliX is installed in the root directory.

root@scb-test-7:/home/SikuliX# /home/SikuliX/jdk-11.0.1/bin/java -jar sikulix.jar -v

RaiMan (raimund-hocke) said : #6

Ok, I do not know the setup of Ubuntu on Azure, but in my Ubuntu 18.04 running in a VirtualBox locally, the .SikuliX folder is installed in the user's home directory.

Your situation at least looks odd, but I have no idea, wether this has something todo with your problem.

Try this: delete the folder .SikuliX and try again.

RaiMan (raimund-hocke) said : #7

Uuups, sorry.

Deleting .SikuliX/Lib should be sufficient.

If you delete .SikuliX completely, you have to again add the Jython jar to the folder where you have the sikulix.jar

Punitha (punithap) said : #8

Hi Raiman,

I have delete the .Sikulix/Lib and again added the Jython jar to the folder having sikulix.jar.

Now am getting the following error:

[3909 debug] IDE: Init ScriptingSupport
[3910 debug] ScriptingSupport: initScriptingSupport: enter
[5970 debug] JythonSupport: init: starting
[5970 debug] JythonSupport: init: success
[5972 debug] JythonSupport: ***** Jython sys.path
 0: /root/.Sikulix/Lib
 1: /root/.Sikulix/Extensions/Lib
 2: /root/.Sikulix/Extensions/jython-standalone-2.7.1.jar/Lib
 3: __classpath__
 4: __pyclasspath__/
[5973 debug] JythonSupport: ***** Jython sys.path end
[6079 debug] Jython: sikuli: Sikuli: starting init
[6986 debug] Mouse: init start
[7492 debug] Mouse: init end
[error] RunTimeIDE: loadLib: opencv_java not usable:
java.lang.UnsatisfiedLinkError: no opencv_java in java.library.path
[error] RunTimeIDE: *** terminating: problem with native library: opencv_java
[7525 debug] RunTimeIDE: final cleanup
[7528 debug] FileManager: deleteFileOrFolder:
/tmp/Sikulix_1060214220
[DEBUG] RunIDE: terminating: returned: 1

RaiMan (raimund-hocke) said : #9

ok, now we are getting nearer ;-)

This is your homework now, sorry:
https://sikulix-2014.readthedocs.io/en/latest/newslinux.html#version-1-1-4-special-for-linux-people

... to get a valid OpenCV and Tesseract support

RaiMan (raimund-hocke) said : #10

be aware: More I cannot do for you.

If you do not succeed, an option is to try with SikuliX 1.1.3 or Ubuntu 18

Can you help with this problem?

Provide an answer of your own, or ask Punitha for more information if necessary.

To post a message you must log in.