简体   繁体   中英

Error installing Sikuli in Python

I am trying to install Sikuli in Python . I have Python-3.4.1 32 bit on a Windows 7 64 bit machine.

When I execute the command:

 pip.exe install sikuli

(pip.exe is installed in -> C:\\Python34\\Scripts)

It gives me the error:

Downloading/unpacking sikuli Running setup.py (path:C:\\Users\\arun_m\\AppData\\Local\\Temp\\pip_build_arun_m\\sikuli\\setup.py) egg_info for package sikuli No local packages or download links found for jnius>=1.1-dev Traceback (most recent call last): File "", line 17, in File "C:\\Users\\arun_m\\AppData\\Local\\Temp\\pip_build_arun_m\\sikuli\\setup.py", line 39, in 'Development Status :: 4 - Beta' File "C:\\Python34\\lib\\distutils\\core.py", line 108, in setup _setup_distribution = dist = klass(attrs) File "C:\\Python34\\lib\\site-packages\\setuptools\\dist.py", line 239, in init self.fetch_build_eggs(attrs.pop('setup_requires')) File "C:\\Python34\\lib\\site-packages\\setuptools\\dist.py", line 263, in fetch_build_eggs parse_requirements(requires), installer=self.fetch_build_egg File "C:\\Python34\\lib\\site-packages\\pkg_resources.py", line 564, in resolve dist = best[req.key] = env.best_match(req, self, installer) File "C:\\Python34\\lib\\site-packages\\pkg_resources.py", line 802, in best_match return self.obtain(re q, installer) # try and download/install File "C:\\Python34\\lib\\site-packages\\pkg_resources.py", line 814, in obtain return installer(requirement) File "C:\\Python34\\lib\\site-packages\\setuptools\\dist.py", line 313, in fetch_build_egg return cmd.easy_install(req) File "C:\\Python34\\lib\\site-packages\\setuptools\\command\\easy_install.py", line 587, in easy_install raise DistutilsError(msg) distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('jnius>=1.1-dev') Complete output from command python setup.py egg_info: No local packages or download links found for jnius>=1.1-dev

Traceback (most recent call last):

File "", line 17, in

File "C:\\Users\\arun_m\\AppData\\Local\\Temp\\pip_build_arun_m\\sikuli\\setup.py", line 39, in

 'Development Status :: 4 - Beta' 

File "C:\\Python34\\lib\\distutils\\core.py", line 108, in setup

 _setup_distribution = dist = klass(attrs) 

File "C:\\Python34\\lib\\site-packages\\setuptools\\dist.py", line 239, in init

 self.fetch_build_eggs(attrs.pop('setup_requires')) 

File "C:\\Python34\\lib\\site-packages\\setuptools\\dist.py", line 263, in fetch_build_eggs

 parse_requirements(requires), installer=self.fetch_build_egg 

File "C:\\Python34\\lib\\site-packages\\pkg_resources.py", line 564, in resolve

 dist = best[req.key] = env.best_match(req, self, installer) 

File "C:\\Python34\\lib\\site-packages\\pkg_resources.py", line 802, in best_match

 return self.obtain(req, installer) # try and download/install 

File "C:\\Python34\\lib\\site-packages\\pkg_resources.py", line 814, in obtain

 return installer(requirement) 

File "C:\\Python34\\lib\\site-packages\\setuptools\\dist.py", line 313, in fetch_build_egg

 return cmd.easy_install(req) 

File "C:\\Python34\\lib\\site-packages\\setuptools\\command\\easy_install.py", line 587, in easy_install

 raise DistutilsError(msg) 

distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('jnius>=1.1-dev')

---------------------------------------- Cleaning up... Command python setup.py egg_info failed with error code 1 in C:\\Users\\arun_m\\AppData\\Local\\Temp\\pip_build_arun_m\\sikuli Storing debug log for failure in C:\\Users\\arun_m\\pip\\pip.log

What do I do to get it installed?

I can execute the Sikuli script from a Python Script but I want to have this installed in Python so that I can use it from within Python by using:

from sikuli import *

Sikuli is not available in CPython (my assumption of what you mean by 'Python'). This would have to be installed 'in' Jython and is still interpreter dependent. I don't use the sikuli IDE because it has no IDE features, but then you run into an issue where Sikuli cannot be run in all IDE's. The IDE must be able to load the .jar correctly. Try Eclipse: http://doc.sikuli.org/faq/040-other-ide.html . My Eclipse project is set up following these directions and I can simply run-as Jython and the script will execute the Sikuli part of the script as expected.

There is no python package available for standalone Sikuli.

Are you trying to install Python-Sikuli-Client as the only sikuli package available at below location https://pypi.python.org/pypi/python-sikuli-client

SikuliX-1.1.0 is latest Sikuli installation available. It comes in executable jars format and you need JRE 1.6 or higher installed on your system to install SikuliX. It has it's own IDE or you can use Jython as interpreter to compile and run your python scripts written for Sikuli in IDEs like Eclipse with PyDev plugin.

Sikuli script is older version for Sikuli and again it is JAVA jar executable file and needs JRE to run and install it.

For sikuli module installation, you should satisfy the jnius module dependency. jnius installation failed for me, so I built it from sources and installed manually.

After jnius installation, you are free to install sikuli via pip . Before using sikuli , you also need to do the following things:

  1. Add path to JRE jvm.dll to the PATH environment variable, eg:

    "C:\\Program Files (x86)\\Java\\jre1.8.0_101\\bin\\client"

  2. Increase JVM heap:

    set _JAVA_OPTIONS=-Xmx512M (in Windows)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM