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

Bug #1801077 reported by Punitha

This bug report was converted into a question: question #675848: Not able to install sikulix 1.1.4 version in my Ubuntu16.04.5 machine in Azure.

6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Invalid
Undecided
Unassigned

Bug Description

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.

Revision history for this message
RaiMan (raimund-hocke) wrote :

should be a question

Changed in sikuli:
status: New → Invalid
Revision history for this message
Punitha (punithap) wrote :

Hi Raiman,

Kindly support us to resolve the mentioned error for successfuly installation of Sikulix.

Thanks,
Punitha

Revision history for this message
Punitha (punithap) wrote :

Details of the error:
[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

Revision history for this message
cat123 (jazzycat2013) wrote :

This workflow worked in my case. I think the reason was a clash with the previous installations of Sikuli (I had used 1.1.2 and 1.1.3 versions before).

1. Delete the folder: C:\Users\Your_User_Name\AppData\Roaming\Sikulix
2. Run the script again.
3. For some reason, I had an error at first try (can be specific to my case)
4. On second try, the script worked properly.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.