ImportError: No module named math

Asked by PowerPenguin on 2019-08-13

I'm using Windows 10, 64 bits. I'm trying to create a random number and if I add the line:

import random

To my code, I get this error:

[error] script [ testing ] stopped with error in line 1
[error] ImportError ( !!WHILE IMPORTING!! No module named math )
[error] --- Traceback --- error source first
line: module ( function ) statement
45: random ( <module> ) File "C:\Users\Irene\AppData\Roaming\Sikulix\Lib\sikuli\SikuliImporter.py", line 41, in load_module
1: main ( <module> ) import random
[error] --- Traceback --- end --

This is all the code I have:

import random
random.randint(3,15)

I'm using the SikulixIDE 1.1.4 and I've run the file "jython-standalone-2.7.1" that it's available on the download section before.

I had another installation of SikulixIDE in a different computer and I didn't receive this error, but I didn't do anything different with the installation in this computer.

What could I do to fix it? I'll try to provide all the information you need in order to reach an answer.

Thank you!

Question information

Language:
English Edit question
Status:
Needs information
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2019-08-13
Last reply:
2019-08-15
RaiMan (raimund-hocke) said : #1

--- I'm using the SikulixIDE 1.1.4 and I've run the file "jython-standalone-2.7.1" that it's available on the download section before.

not really sure what you are doing.

If you follow the instructions on the downloadpage and run sikulix.jar (which starts the SikuliX IDE), your code works.

So what do you mean by: I've run the file "jython-standalone-2.7.1"? no need to do that.

Can you help with this problem?

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

To post a message you must log in.