shish / sikulpy

A reimplementation of the Sikuli API for CPython
Other
31 stars 10 forks source link

Installation problems sikuli on windows (python 2.7.13/32 bit) #16

Closed wolfc01 closed 7 years ago

wolfc01 commented 7 years ago

Hello,

I have tested installation of sikulpy further where the following issues popped up:


and 

byte-compiling build\bdist.win32\egg\sikuli\script\rectangle.py to rectangle.pyc File "build\bdist.win32\egg\sikuli\script\rectangle.py", line 29 def setX(self, x: int): self.x = x ^ SyntaxError: invalid syntax



Hope you can fix this, best regards
Carl.
wolfc01 commented 7 years ago

For a complete log of the entire installation (python, all deps and sikulpy) see below:

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. Alle rechten voorbehouden.

C:\Users\cn>python
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D

C:\Users\cn>pip install pillow
Collecting pillow
  Using cached Pillow-4.0.0-cp27-cp27m-win32.whl
Collecting olefile (from pillow)
  Using cached olefile-0.44.zip
Installing collected packages: olefile, pillow
  Running setup.py install for olefile ... done
Successfully installed olefile-0.44 pillow-4.0.0

C:\Users\cn>python
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import PIL
>>> ^Z

C:\Users\cn>pip install pyscreenshot
Collecting pyscreenshot
  Downloading pyscreenshot-0.4.2.tar.gz
Collecting EasyProcess (from pyscreenshot)
  Downloading EasyProcess-0.2.3.tar.gz
Installing collected packages: EasyProcess, pyscreenshot
  Running setup.py install for EasyProcess ... done
  Running setup.py install for pyscreenshot ... done
Successfully installed EasyProcess-0.2.3 pyscreenshot-0.4.2

C:\Users\cn>pip install numpy
Collecting numpy
  Downloading numpy-1.11.3-cp27-none-win32.whl (6.5MB)
    100% |################################| 6.5MB 137kB/s
Installing collected packages: numpy
Successfully installed numpy-1.11.3

C:\Users\cn>python
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> ^Z

C:\Users\cn>pip install opencv-python
Collecting opencv-python
  Downloading opencv_python-3.2.0.6-cp27-cp27m-win32.whl (18.9MB)
    100% |################################| 18.9MB 46kB/s
Requirement already satisfied: numpy>=1.11.3 in c:\python27\lib\site-packages (from opencv-python)
Installing collected packages: opencv-python
Successfully installed opencv-python-3.2.0.6

C:\Users\cn>

C:\Users\cn\Desktop\sikulpy-master>python setup.py install
Error importing sikuli: No module named enum
running install
running bdist_egg
running egg_info
creating sikulpy.egg-info
writing requirements to sikulpy.egg-info\requires.txt
writing sikulpy.egg-info\PKG-INFO
writing top-level names to sikulpy.egg-info\top_level.txt
writing dependency_links to sikulpy.egg-info\dependency_links.txt
writing entry points to sikulpy.egg-info\entry_points.txt
writing manifest file 'sikulpy.egg-info\SOURCES.txt'
reading manifest file 'sikulpy.egg-info\SOURCES.txt'
writing manifest file 'sikulpy.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_py
creating build
creating build\lib
creating build\lib\sikuli
copying sikuli\find.py -> build\lib\sikuli
copying sikuli\run.py -> build\lib\sikuli
copying sikuli\version.py -> build\lib\sikuli
copying sikuli\__init__.py -> build\lib\sikuli
creating build\lib\sikuli\script
copying sikuli\script\app.py -> build\lib\sikuli\script
copying sikuli\script\env.py -> build\lib\sikuli\script
copying sikuli\script\exc.py -> build\lib\sikuli\script
copying sikuli\script\finder.py -> build\lib\sikuli\script
copying sikuli\script\image.py -> build\lib\sikuli\script
copying sikuli\script\key.py -> build\lib\sikuli\script
copying sikuli\script\location.py -> build\lib\sikuli\script
copying sikuli\script\match.py -> build\lib\sikuli\script
copying sikuli\script\pattern.py -> build\lib\sikuli\script
copying sikuli\script\rectangle.py -> build\lib\sikuli\script
copying sikuli\script\region.py -> build\lib\sikuli\script
copying sikuli\script\robot.py -> build\lib\sikuli\script
copying sikuli\script\screen.py -> build\lib\sikuli\script
copying sikuli\script\settings.py -> build\lib\sikuli\script
copying sikuli\script\sikulpy.py -> build\lib\sikuli\script
copying sikuli\script\__init__.py -> build\lib\sikuli\script
creating build\bdist.win32
creating build\bdist.win32\egg
creating build\bdist.win32\egg\sikuli
copying build\lib\sikuli\find.py -> build\bdist.win32\egg\sikuli
copying build\lib\sikuli\run.py -> build\bdist.win32\egg\sikuli
creating build\bdist.win32\egg\sikuli\script
copying build\lib\sikuli\script\app.py -> build\bdist.win32\egg\sikuli\script
copying build\lib\sikuli\script\env.py -> build\bdist.win32\egg\sikuli\script
copying build\lib\sikuli\script\exc.py -> build\bdist.win32\egg\sikuli\script
copying build\lib\sikuli\script\finder.py -> build\bdist.win32\egg\sikuli\script
copying build\lib\sikuli\script\image.py -> build\bdist.win32\egg\sikuli\script
copying build\lib\sikuli\script\key.py -> build\bdist.win32\egg\sikuli\script
copying build\lib\sikuli\script\location.py -> build\bdist.win32\egg\sikuli\script
copying build\lib\sikuli\script\match.py -> build\bdist.win32\egg\sikuli\script
copying build\lib\sikuli\script\pattern.py -> build\bdist.win32\egg\sikuli\script
copying build\lib\sikuli\script\rectangle.py -> build\bdist.win32\egg\sikuli\script
copying build\lib\sikuli\script\region.py -> build\bdist.win32\egg\sikuli\script
copying build\lib\sikuli\script\robot.py -> build\bdist.win32\egg\sikuli\script
copying build\lib\sikuli\script\screen.py -> build\bdist.win32\egg\sikuli\script
copying build\lib\sikuli\script\settings.py -> build\bdist.win32\egg\sikuli\script
copying build\lib\sikuli\script\sikulpy.py -> build\bdist.win32\egg\sikuli\script
copying build\lib\sikuli\script\__init__.py -> build\bdist.win32\egg\sikuli\script
copying build\lib\sikuli\version.py -> build\bdist.win32\egg\sikuli
copying build\lib\sikuli\__init__.py -> build\bdist.win32\egg\sikuli
byte-compiling build\bdist.win32\egg\sikuli\find.py to find.pyc
byte-compiling build\bdist.win32\egg\sikuli\run.py to run.pyc
byte-compiling build\bdist.win32\egg\sikuli\script\app.py to app.pyc
byte-compiling build\bdist.win32\egg\sikuli\script\env.py to env.pyc
byte-compiling build\bdist.win32\egg\sikuli\script\exc.py to exc.pyc
byte-compiling build\bdist.win32\egg\sikuli\script\finder.py to finder.pyc
  File "build\bdist.win32\egg\sikuli\script\finder.py", line 28
    def next(self) -> Match:
                   ^
SyntaxError: invalid syntax

byte-compiling build\bdist.win32\egg\sikuli\script\image.py to image.pyc
byte-compiling build\bdist.win32\egg\sikuli\script\key.py to key.pyc
byte-compiling build\bdist.win32\egg\sikuli\script\location.py to location.pyc
byte-compiling build\bdist.win32\egg\sikuli\script\match.py to match.pyc
byte-compiling build\bdist.win32\egg\sikuli\script\pattern.py to pattern.pyc
byte-compiling build\bdist.win32\egg\sikuli\script\rectangle.py to rectangle.pyc
  File "build\bdist.win32\egg\sikuli\script\rectangle.py", line 29
    def setX(self, x: int): self.x = x
                    ^
SyntaxError: invalid syntax

byte-compiling build\bdist.win32\egg\sikuli\script\region.py to region.pyc
byte-compiling build\bdist.win32\egg\sikuli\script\robot.py to robot.pyc
byte-compiling build\bdist.win32\egg\sikuli\script\screen.py to screen.pyc
byte-compiling build\bdist.win32\egg\sikuli\script\settings.py to settings.pyc
byte-compiling build\bdist.win32\egg\sikuli\script\sikulpy.py to sikulpy.pyc
byte-compiling build\bdist.win32\egg\sikuli\script\__init__.py to __init__.pyc
byte-compiling build\bdist.win32\egg\sikuli\version.py to version.pyc
byte-compiling build\bdist.win32\egg\sikuli\__init__.py to __init__.pyc
creating build\bdist.win32\egg\EGG-INFO
copying sikulpy.egg-info\PKG-INFO -> build\bdist.win32\egg\EGG-INFO
copying sikulpy.egg-info\SOURCES.txt -> build\bdist.win32\egg\EGG-INFO
copying sikulpy.egg-info\dependency_links.txt -> build\bdist.win32\egg\EGG-INFO
copying sikulpy.egg-info\entry_points.txt -> build\bdist.win32\egg\EGG-INFO
copying sikulpy.egg-info\requires.txt -> build\bdist.win32\egg\EGG-INFO
copying sikulpy.egg-info\top_level.txt -> build\bdist.win32\egg\EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist\sikulpy-0.0.0-py2.7.egg' and adding 'build\bdist.win32\egg' to it
removing 'build\bdist.win32\egg' (and everything under it)
Processing sikulpy-0.0.0-py2.7.egg
Copying sikulpy-0.0.0-py2.7.egg to c:\python27\lib\site-packages
Adding sikulpy 0.0.0 to easy-install.pth file
Installing sikulpy-find-script.py script to C:\Python27\Scripts
Installing sikulpy-find.exe script to C:\Python27\Scripts
Installing sikulpy-find.exe.manifest script to C:\Python27\Scripts
Installing sikulpy-script.py script to C:\Python27\Scripts
Installing sikulpy.exe script to C:\Python27\Scripts
Installing sikulpy.exe.manifest script to C:\Python27\Scripts

Installed c:\python27\lib\site-packages\sikulpy-0.0.0-py2.7.egg
Processing dependencies for sikulpy==0.0.0
Searching for numpy==1.11.3
Best match: numpy 1.11.3
Adding numpy 1.11.3 to easy-install.pth file

Using c:\python27\lib\site-packages
Searching for Pillow==4.0.0
Best match: Pillow 4.0.0
Adding Pillow 4.0.0 to easy-install.pth file

Using c:\python27\lib\site-packages
Searching for autopy==0.51
Best match: autopy 0.51
Adding autopy 0.51 to easy-install.pth file

Using c:\python27\lib\site-packages
Searching for pyscreenshot==0.4.2
Best match: pyscreenshot 0.4.2
Adding pyscreenshot 0.4.2 to easy-install.pth file

Using c:\python27\lib\site-packages
Searching for olefile==0.44
Best match: olefile 0.44
Adding olefile 0.44 to easy-install.pth file

Using c:\python27\lib\site-packages
Searching for EasyProcess==0.2.3
Best match: EasyProcess 0.2.3
Adding EasyProcess 0.2.3 to easy-install.pth file

Using c:\python27\lib\site-packages
Finished processing dependencies for sikulpy==0.0.0

C:\Users\cn\Desktop\sikulpy-master>

Best regards Carl.

wolfc01 commented 7 years ago

Hello ,

an addition for this issue, fixing the enum dependency by installing enum package:

C:\Users\cn\Desktop\sikulpy-master>python
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sikuli
Error importing sikuli: No module named enum
>>> ^Z
C:\Users\cn\Desktop\sikulpy-master>

C:\Users\cn\Desktop\sikulpy-master>pip install enum
Collecting enum
  Downloading enum-0.4.6.tar.gz
Requirement already satisfied: setuptools in c:\python27\lib\site-packages (from enum)
Installing collected packages: enum
  Running setup.py install for enum ... done
Successfully installed enum-0.4.6

C:\Users\cn\Desktop\sikulpy-master>

C:\Users\cn\Desktop\sikulpy-master>python
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sikuli
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "sikuli\__init__.py", line 2, in <module>
    from .script import *
  File "sikuli\script\__init__.py", line 4, in <module>
    from .app import App
  File "sikuli\script\app.py", line 3, in <module>
    from .region import Region
  File "sikuli\script\region.py", line 14, in <module>
    from .rectangle import Rectangle
  File "sikuli\script\rectangle.py", line 29
    def setX(self, x: int): self.x = x
                    ^
SyntaxError: invalid syntax
>>>

I think the code is currently ony suitable for python 3 because of the type annotations. Are you willing to keep the code compatible with python 2.7?

Best regards Carl.

shish commented 7 years ago

Type annotations were supposed to be removed for the sake of 2.7 compatibility, looks like a couple got missed - have removed those and added enum to setup.py :)

wolfc01 commented 7 years ago

Thanks,

I cannot test further as autopy3 install seems to be broken on python 2.7 on windows.

C:\Users\cn\Desktop\sikulpy_prereqs>pip install autopy
Collecting autopy
  Using cached autopy-0.51.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\cn\appdata\local\temp\pip-build-0tenxd\autopy\setup.py", line 222, in <module>
        EXT_MODULES = create_ext_modules('src/')
      File "c:\users\cn\appdata\local\temp\pip-build-0tenxd\autopy\setup.py", line 180, in create_ext_modules
        raise IOError('windows directory not found at: "%s"' % win_dir)
    IOError: windows directory not found at: "c:\users\cn\appdata\local\temp\pip-build-0tenxd\autopy\windows\win32"

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\cn\appdata\local\temp\pip-build-0tenxd\autopy\

Any clue? How do you test under windows?

Best regards Carl.

wolfc01 commented 7 years ago

autopy does install using windows installer, found on https://pypi.python.org/pypi/autopy/

Thanks Carl

wolfc01 commented 7 years ago

Install now seems to work. This issue can be closed.

Best regards Carl.