Getting “encoding' is an invalid keyword argument for this function” On Installing pyautogui via PIP

蹲街弑〆低调 提交于 2021-02-05 07:16:15

问题


I'm getting this error when I'm trying to install "pyautogui" library to python. Please find the details below -

ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "################\pip-install-pmckiy\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:\################\pip-install-pmckiy\pygetwindow\

Python Version - 2.7.12

Things I have already tried -

1.) I have upgraded the pip, current version - pip 19.1.1

2.) I also followed the steps as given in this another answer

"pip install unroll": "python setup.py egg_info" failed with error code 1

3.) Since this is installation I have no control over the code, also I tried to search for this error in the files but no luck, hence below URL also did not help me much -

Is 'encoding is an invalid keyword' error inevitable in python 2.x?

4.) I tried installing setuptools as well but it is also not helping


回答1:


This is a bug in pygetwindow, already reported but not resolved: https://github.com/asweigart/PyGetWindow/issues/9

The problem is that in Python 3 open has parameter encoding, but not in Python 2. That is, the code now requires Python 3.



来源:https://stackoverflow.com/questions/56581057/getting-encoding-is-an-invalid-keyword-argument-for-this-function-on-installi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!