Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install robotframework-ImageHorizonLibrary failed on python 2.7 #38

Closed
gotcha1 opened this issue Jun 10, 2019 · 11 comments
Closed

pip install robotframework-ImageHorizonLibrary failed on python 2.7 #38

gotcha1 opened this issue Jun 10, 2019 · 11 comments

Comments

@gotcha1
Copy link

gotcha1 commented Jun 10, 2019

pip install robotframework-ImageHorizonLibrary failed on python 2.7 with below error:

ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "", line 1, in
File "c:\users\user\appdata\local\temp\pip-install-py9pto\pygetwindow\setup.py", line 10, in
with open('README.md', 'r', encoding='utf-8') as fh:
TypeError: 'encoding' is an invalid keyword argument for this function
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in c:\users\useri\appdata\local\temp\pip-install-py9pto\pygetwindow\

Setup details:

Robot Framework 3.1.2 (Python 2.7.16 on win32)

@Tattoo
Copy link
Contributor

Tattoo commented Jun 10, 2019

What versions of Python and pip you are using?

@gotcha1
Copy link
Author

gotcha1 commented Jun 10, 2019

Python 2.7.16 (32bit)
pip 19.1.1

@Tattoo
Copy link
Contributor

Tattoo commented Jun 10, 2019

Ok, those seem reasonable.

IHL depends on pyautogui which, in turn, seems to depend on pygetwindow.

It seems pygetwindow broke backwards-compability to Python 2.

I'm not in front of computer for a while so I cannot test, but workaround could be installing older version of pygetwindow, and then pyautogui, then IHL:

$ pip install pygetwindow==0.0.4
$ pip install pyautogui 
$ pip install robotframework-imagehorizonlibrary

If this works, could you confirm in this issue so, thanks

@gotcha1
Copy link
Author

gotcha1 commented Jun 10, 2019

pip install pygetwindow==0.0.4 --> passed
but pip install pyautogui and pip install robotframework-imagehorizonlibrary failed with same error :

File "c:\users\user\appdata\local\temp\pip-install-py9pto\pygetwindow\setup.py", line 10, in
with open('README.md', 'r', encoding='utf-8') as fh:
TypeError: 'encoding' is an invalid keyword argument for this function

ERROR: Command "python setup.py egg_info" failed with error code 1 in c:\users\useri\appdata\local\temp\pip-install-py9pto\pygetwindow\

@Tattoo
Copy link
Contributor

Tattoo commented Jun 10, 2019

which command gives you this? please provide entire output. also, have you uninstalled what you had before running these installation steps?

@gotcha1
Copy link
Author

gotcha1 commented Jun 11, 2019

Yes uninstalled existing pygetwindow and then isntalled pygetwindow--> passed.

pip install pyautogui--> failed with below error:

ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\users\user\appdata\local\temp\pip-install-ebhrlu\pygetwindow\setup.py", line 10, in <module>
    with open('README.md', 'r', encoding='utf-8') as fh:
TypeError: 'encoding' is an invalid keyword argument for this function
----------------------------------------

ERROR: Command "python setup.py egg_info" failed with error code 1 in c:\users\user\appdata\local\temp\pip-install-ebhrlu\pygetwindow\

pip install robotframework-imagehorizonlibrary-->failed with below error:

ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "", line 1, in
File "c:\users\kadali\appdata\local\temp\pip-install-_beol4\pygetwindow\setup.py", line 10, in
with open('README.md', 'r', encoding='utf-8') as fh:
TypeError: 'encoding' is an invalid keyword argument for this function
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in c:\users\kadali\appdata\local\temp\pip-install-_beol4\pygetwindow\

@Tattoo
Copy link
Contributor

Tattoo commented Jun 11, 2019

As I said in the previous message, you need to uninstall everything, then try installing one at a time.

These are not either the full command output one gets in command prompt/terminal. Please provide those.

@gotcha1
Copy link
Author

gotcha1 commented Jun 11, 2019

Uninstall python 2.7 and robot framework also?

C:\Users\user\PycharmProjects\Robot\venv>pip install pyautogui
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting pyautogui
Using cached https://files.pythonhosted.org/packages/a1/06/4be3640cdd7a5d1e9432febf397dfc07ddf1e6a11f24efcc8fa102e35c5f/PyAutoGUI-0.9.44.tar.gz
Collecting pymsgbox (from pyautogui)
Using cached https://files.pythonhosted.org/packages/b6/65/86379ede1db26c40e7972d7a41c69cdf12cc6a0f143749aabf67ab8a41a1/PyMsgBox-1.0.6.zip
Collecting PyTweening>=1.0.1 (from pyautogui)
Using cached https://files.pythonhosted.org/packages/b9/f8/c32a58d6e4dff8aa5c27e907194d69f3b57e525c2e4af96f39c6e9c854d2/PyTweening-1.0.3.zip
Requirement already satisfied: Pillow in c:\python27\lib\site-packages (from pyautogui) (2.9.0)
Collecting pyscreeze>=0.1.21 (from pyautogui)
Using cached https://files.pythonhosted.org/packages/7a/89/3e22a1cbbaa77c81e058bd87b8481f0f331b3da6438cdc77d255a932777c/PyScreeze-0.1.21.tar.gz
Collecting pygetwindow>=0.0.5 (from pyautogui)
Using cached https://files.pythonhosted.org/packages/8c/95/d401a85c5e9a40fac545708961b38beb5a71c9a8fc607de30d31f03de17e/PyGetWindow-0.0.5.tar.gz
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "", line 1, in
File "c:\users\user\appdata\local\temp\pip-install-ebhrlu\pygetwindow\setup.py", line 10, in
with open('README.md', 'r', encoding='utf-8') as fh:
TypeError: 'encoding' is an invalid keyword argument for this function
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in c:\users\user\appdata\local\temp\pip-install-ebhrlu\pygetwindow\

For ImageHorizon:

C:\Users\user\PycharmProjects\Robot\venv>pip install robotframework-imagehorizonlibrary
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting robotframework-imagehorizonlibrary
Using cached https://files.pythonhosted.org/packages/e4/64/6d47e32b56a4930918791d2f626a52b93e1001221d83ed640664335a8201/robotframework-imagehorizonlibrary-0.1.tar.gz
Requirement already satisfied: robotframework>=2.8 in c:\python27\lib\site-packages (from robotframework-imagehorizonlibrary) (3.1.2)
Collecting pyautogui>=0.9.30 (from robotframework-imagehorizonlibrary)
Using cached https://files.pythonhosted.org/packages/a1/06/4be3640cdd7a5d1e9432febf397dfc07ddf1e6a11f24efcc8fa102e35c5f/PyAutoGUI-0.9.44.tar.gz
Collecting pymsgbox (from pyautogui>=0.9.30->robotframework-imagehorizonlibrary)
Using cached https://files.pythonhosted.org/packages/b6/65/86379ede1db26c40e7972d7a41c69cdf12cc6a0f143749aabf67ab8a41a1/PyMsgBox-1.0.6.zip
Collecting PyTweening>=1.0.1 (from pyautogui>=0.9.30->robotframework-imagehorizonlibrary)
Using cached https://files.pythonhosted.org/packages/b9/f8/c32a58d6e4dff8aa5c27e907194d69f3b57e525c2e4af96f39c6e9c854d2/PyTweening-1.0.3.zip
Requirement already satisfied: Pillow in c:\python27\lib\site-packages (from pyautogui>=0.9.30->robotframework-imagehorizonlibrary) (2.9.0)
Collecting pyscreeze>=0.1.21 (from pyautogui>=0.9.30->robotframework-imagehorizonlibrary)
Using cached https://files.pythonhosted.org/packages/7a/89/3e22a1cbbaa77c81e058bd87b8481f0f331b3da6438cdc77d255a932777c/PyScreeze-0.1.21.tar.gz
Collecting pygetwindow>=0.0.5 (from pyautogui>=0.9.30->robotframework-imagehorizonlibrary)
Using cached https://files.pythonhosted.org/packages/8c/95/d401a85c5e9a40fac545708961b38beb5a71c9a8fc607de30d31f03de17e/PyGetWindow-0.0.5.tar.gz
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "", line 1, in
File "c:\users\user\appdata\local\temp\pip-install-_beol4\pygetwindow\setup.py", line 10, in
with open('README.md', 'r', encoding='utf-8') as fh:
TypeError: 'encoding' is an invalid keyword argument for this function
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in c:\users\user\appdata\local\temp\pip-install-_beol4\pygetwindow\

@hernandik
Copy link

I had similar issue. I was able to install using pygetwindow 0.0.1 and pyscreeze 0.1.18

@Tattoo
Copy link
Contributor

Tattoo commented Jun 11, 2019

Just as I suspect:
Collecting pygetwindow>=0.0.5 (from pyautogui>=0.9.30)

So you need to use older version of pyautogui that accepts older version of pygetwindow.

Based on release history and version control, last such version was 0.9.42, so once more :

  • uninstall all three packages in question
  • pip install pygetwindow==0.0.4
  • pip install pyautogui==0.9.42
  • pip install robotframework-imagehorizonlibrary

@gotcha1
Copy link
Author

gotcha1 commented Jun 18, 2019

@Tattoo Thanks a lot! followed above suggestion and it worked.

@matejc matejc closed this as completed Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants