【问题标题】:how to fix error when installing pyautogui on jupyter notebook?在 jupyter notebook 上安装 pyautogui 时如何修复错误?
【发布时间】:2021-09-06 01:09:24
【问题描述】:

我使用我的 anaconda 提示符使用以下行来安装 PyAutoGui:

pip -m install pyautogui

安装似乎成功,但在谷歌上导入库 pyautogui 时 colab,我收到以下错误:

KeyError Traceback(最近调用 最后)在() ----> 1 导入pyautogui

2 帧 /usr/lib/python3.7/os.py 在 getitem(self, key) 679,除了 KeyError: 680 # 使用原始键值引发 KeyError --> 681 从无引发 KeyError(key) 第682章 683

KeyError: '显示'

我能做些什么来解决这个问题?

【问题讨论】:

    标签: python installation package google-colaboratory pyautogui


    【解决方案1】:

    我发现了一个有趣的材料:

    https://tylergarrett.com/code/2018/11/using-pyautogui-with-colaboratory-not-possible-today/

    简而言之,作者是这么说的

    “目前无法将 Pyautogui 与 Colaboratory 一起使用,因为 代码没有在活动显示下运行,而更像是 基于 web 的地方运行 python"。

    "GUI 自动化应该在本地机器上完成,并且 Colaboratory 不会是 GUI 自动化的地方,因为它是一个 在线协作工具。”

    https://colab.research.google.com/drive/1UtSMGU5UaGowWA9mM3Kq7QR-LBzbbFDE?usp=sharing

    【讨论】:

      猜你喜欢
      • 2021-07-24
      • 1970-01-01
      • 2022-10-24
      • 2020-12-22
      • 1970-01-01
      • 2019-04-08
      • 1970-01-01
      • 1970-01-01
      • 2020-07-17
      相关资源
      最近更新 更多