← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #234935]: "import random" suddenly stopped working.

 

Question #234935 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/234935

    Status: Open => Answered

RaiMan proposed the following answer:
this usually happens if you have a .sikuli script with the same name as
an imported module in the same folder as the running script.

In your case, I guess, there is random.sikuli in the folder or even the
running script has this name.

One rule in Sikuli (since importing .sikuli scripts has precedence):
Do not have scripts named xxx.sikuli in the same folder as the running script or on sys.path, where xxx is the name of a normal Python module, you want to import.

Take care: when renaming xxx.sikuli to xxxzzz.sikuli: either use File ->
SaveAs or take care, that the contained .py file has the same name as
the script (xxxzzz.py in this case)

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.