当前位置:   article > 正文

MAC 和 python模拟键鼠操作_there is no current event loop in thread 'threadpo

there is no current event loop in thread 'threadpoolexecutor-0_0

本文部分内容摘抄 

PyUserInput在macOS中的安装(解决Quartz和AppKit安装的神坑!!)_Devin13的博客-CSDN博客

PyUserInput在macOS中的安装(解决Quartz和AppKit安装的神坑!!)

安装步骤

  1. 安装quartz

                1> 先下载 quartz

                2> 提取后找到setup.py文件,找到以下行:

                install_requires=read_dependencies(“requirements.txt")

                  将其修改为:

                  install_requires=read_dependencies("quartz.egg-info/requires.txt")

                3>  回到quartz-0.0.1.dev0文件的父级目录,运行以下命令:

                        pip install -e quartz-0.0.1.dev0

2. 安装AppKit,其实是PyObjC PyObjC-core

        sudo pip install --upgrade --force-reinstall PyObjC PyObjC-core

3. 最后安装 pip install PyUserInput

Questions:

1. 在最开始没有安装 quartz  PyObjC PyObjC-core 之前,只安装了PyUserInput 运行脚本报如下错误

raise RuntimeError('There is no current event loop in thread %!r(MISSING).'

RuntimeError: There is no current event loop in thread 'ThreadPoolExecutor-0_0'.

解决问题:

重新安装 步骤1 和2

quartz  PyObjC PyObjC-core

2. 在安装了quart 和PyObjC 后运行程序报错,

import PyObjCTools.KeyValueCoding as kvc

ModuleNotFoundError: No module named 'PyObjCTools.KeyValueCoding'

重新执行脚本即可解决 : sudo pip install --upgrade --force-reinstall PyObjC PyObjC-core

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/272337
推荐阅读
相关标签
  

闽ICP备14008679号