获取“编码"是此函数的无效关键字参数";通过 PIP 安装 pyautogui [英] Getting "encoding' is an invalid keyword argument for this function" On Installing pyautogui via PIP

查看:102
本文介绍了获取“编码"是此函数的无效关键字参数";通过 PIP 安装 pyautogui的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试将pyautogui"库安装到 python 时出现此错误.请在下面找到详细信息 -

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 版本 - 2.7.12

我已经尝试过的东西 -

Things I have already tried -

1.) 我已经升级了 pip,当前版本 - pip 19.1.1

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

2.) 我也遵循了另一个答案中给出的步骤

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

"pip安装展开":python setup.py egg_info"失败,错误代码 1

3.) 由于这是安装,我无法控制代码,我也尝试在文件中搜索此错误但没有运气,因此下面的 URL 也对我没有太大帮助 -

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 -

是'编码是一个在python 2.x中不可避免的无效关键字错误?

4.) 我也尝试安装 setuptools,但它也没有帮助

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

推荐答案

这是 pygetwindow 中的一个 bug,已经报告但未解决:https://github.com/asweigart/PyGetWindow/issues/9

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

问题是在 Python 3 open 有参数 encoding,但 不在Python 2.也就是说,代码现在需要 Python 3.

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

这篇关于获取“编码"是此函数的无效关键字参数";通过 PIP 安装 pyautogui的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆