Run SKL from the command line,set UTF-8,it doesn't work
hi,RaiMan
q1:
i run a SKL from the command line,and set like this:
java -Dfile.
it can run,but the console output chinese garbled
the sikulix-ide version is 2.1.0
q2:
i want to import some other python modules,
set the sites.txt like this:
D:\Program Files (x86)\python\
and then restart the IDE,so i import a module like:from apscheduler.
it doesn't work:
[error] script [ 1 ] stopped with error in line 10
[error] ImportError ( No module named apscheduler )
[error] --- Traceback --- error source first
line: module ( function ) statement
10: main ( <module> ) from apscheduler.
[error] --- Traceback --- end --------------
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Sikuli Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- RaiMan
- Solved:
- 2019-11-09
- Last query:
- 2019-11-09
- Last reply:
- 2019-11-07
RaiMan (raimund-hocke) said : | #3 |
at q1:
-Dfile.
this setting only affects files internally loaded by Java.
Output to the commandline (in your case done by Python/Jython print) cannot handle UTF-8.
use uprint() instaed of print or implement your own encoding.
at q2:
run the IDE from command line like this:
java -jar <path-to>
and watch the log on command line.
check the content of sys.path after startup.
DCWOO (qjhpao110) said : | #4 |
thanks so much for reply,
The first problem is solved,that i add 'u' like this:print(
The second problem:
i have checked the content in the command line that it include the path like this:
[debug] Jython: ***** sys.path
0: D:\Program Files\sikuli\
1: C:\Users\
2: C:\Users\
3: C:\Users\
4: C:\Users\
2.7.1.jar\Lib
7: D:\Program Files\Python\
[5846 debug] JythonRunner: ready: version 2.7.1
when i run it:
[error] script [ 22 ] stopped with error in line 15
[error] ImportError ( No module named six )
[error] --- Traceback --- error source first
line: module ( function ) statement
12: base ( <module> ) import six
5: background ( <module> ) from apscheduler.
duler
15: main ( <module> ) from apscheduler.
undScheduler
[error] --- Traceback --- end --------------
[debug] RunTime:***** running cleanUp *****
|
#5 |
related to the chinese print out I cannot help you. I do not have the environment.
--- import problem:
apparently the import principally works.
The problem is with a sub-module six of apscheduler
The reason might be, that the Python apscheduler module cannot be used with Jython. In most cases the reason is, that it depends on some C-based stuff or native librarioes.
If this is the case, then you have to find another solution.
DCWOO (qjhpao110) said : | #6 |
Thanks RaiMan, that solved my question.