首页 > 解决方案 > 在 pyautogui 安装期间出现错误“TypeError:'encoding' is an invalid keyword argument for this function”

问题描述

我想pyautogui, openpyxl在没有连接到互联网的机器上安装 Python。

在具有互联网连接的计算机上,我打开命令行并执行以下命令。

pip download pyautogui openpyxl

将所有下载的文件复制到目标机器,然后安装

pip install ...

其中... 表示所有下载的文件。都在一条线上。

执行此操作时出现以下错误-

with open('README.md', 'r', encoding='utf-8') as fh:
    TypeError: 'encoding' is an invalid keyword argument for this function


 C:\Temp\DSNImport>cd "C:\Temp\DSNImport\picu\python libraries"
      C:\Temp\DSNImport\picu\python libraries>pip install openpyxl-2.6.2.tar.gz PyAutoGUI-0.9.44.tar.gz et_xmlfile-1.0.1.tar.gz jdcal-1.4.1-py2.py3-none-any.whl Pillow-6.0.0.tar.gz PyGetWindow-0.0.5.tar.gz PyRect-0.1.4.tar.gz PyScreeze-0.1.21.tar.gz
    Processing c:\temp\dsnimport\picu\python libraries\openpyxl-2.6.2.tar.gz
    Processing c:\temp\dsnimport\picu\python libraries\pyautogui-0.9.44.tar.gz
    Processing c:\temp\dsnimport\picu\python libraries\et_xmlfile-1.0.1.tar.gz
      Requirement already satisfied (use --upgrade to upgrade): et-xmlfile==1.0.1 from file:///C:/Temp/DSNImport/picu/python%20libraries/et_xmlfile-1.0.1.tar.gz in c:\programdata\anaconda2\lib\site-packages
    Processing c:\temp\dsnimport\picu\python libraries\pillow-6.0.0.tar.gz
    Processing c:\temp\dsnimport\picu\python libraries\pygetwindow-0.0.5.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\superu~1\appdata\local\temp\pip-bbamct-build\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
       ----------------------------------------   Command "python setup.py egg_info" failed with error code 1 in c:\users\superu~1\appdata\local\temp\pip-bbamct-build\
       C:\Temp\DSNImport\picu\python libraries>

如何安装“pyautogui”?

标签: python

解决方案


推荐阅读