IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> Python知识库 -> airtest报错ModuleNotFoundError: No module named ‘poco‘解决记录 -> 正文阅读

[Python知识库]airtest报错ModuleNotFoundError: No module named ‘poco‘解决记录

问题描述

在执行airtest测试脚本时,一直提示报错ModuleNotFoundError: No module named ‘poco’

Traceback:
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_pytest/python.py:608: in _importtestmodule
    mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_pytest/pathlib.py:533: in import_path
    importlib.import_module(module_name)
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:168: in exec_module
    exec(co, module.__dict__)
test_hello.py:13: in <module>
    from poco.exceptions import *
E   ModuleNotFoundError: No module named 'poco'

而尝试用pip3 install poco安装时,又提示报如下错误:

Collecting poco
  Using cached poco-0.98.1.tar.gz (34 kB)
  Preparing metadata (setup.py) ... done
Collecting pyyaml==3.13
  Using cached PyYAML-3.13.tar.gz (270 kB)
  Preparing metadata (setup.py) ... done
Collecting pyaml==18.11.0
  Using cached pyaml-18.11.0-py2.py3-none-any.whl (16 kB)
Collecting svn==0.3.46
  Using cached svn-0.3.46.tar.gz (12 kB)
  Preparing metadata (setup.py) ... done
Collecting gitpython==2.1.15
  Using cached GitPython-2.1.15-py2.py3-none-any.whl (452 kB)
Collecting docopt==0.6.2
  Using cached docopt-0.6.2.tar.gz (25 kB)
  Preparing metadata (setup.py) ... done
Collecting docker-compose==1.23.2
  Using cached docker_compose-1.23.2-py2.py3-none-any.whl (131 kB)
Collecting pygithub==1.43.5
  Using cached PyGithub-1.43.5.tar.gz (2.9 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      error in PyGithub setup command: use_2to3 is invalid.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

解决方法

应该安装pocoui,而不是poco。执行pip3 install pocoui,如下:

~ % pip3  install pocoui
Collecting pocoui
  Downloading pocoui-1.0.87.tar.gz (2.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.8/2.8 MB 1.5 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: six in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from pocoui) (1.16.0)
Requirement already satisfied: requests in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from pocoui) (2.27.1)
Requirement already satisfied: airtest in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from pocoui) (1.2.5)
Collecting hrpc>=1.0.9
  Downloading hrpc-1.0.9.tar.gz (7.0 kB)
  Preparing metadata (setup.py) ... done
Collecting websocket-client==0.48.0
  Downloading websocket_client-0.48.0-py2.py3-none-any.whl (198 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 198.4/198.4 KB 7.2 MB/s eta 0:00:00
Requirement already satisfied: Jinja2>=2.8 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from airtest->pocoui) (3.1.2)
Requirement already satisfied: Pillow>=3.4.0 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from airtest->pocoui) (9.0.1)
Requirement already satisfied: mss==6.1.0 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from airtest->pocoui) (6.1.0)
Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from airtest->pocoui) (1.22.3)
Requirement already satisfied: opencv-contrib-python in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from airtest->pocoui) (4.5.5.64)
Requirement already satisfied: facebook-wda>=1.3.3 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from airtest->pocoui) (1.4.6)
Requirement already satisfied: pywinauto==0.6.3 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from airtest->pocoui) (0.6.3)
Requirement already satisfied: python-xlib in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from pywinauto==0.6.3->airtest->pocoui) (0.31)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from requests->pocoui) (1.26.9)
Requirement already satisfied: idna<4,>=2.5 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from requests->pocoui) (3.3)
Requirement already satisfied: charset-normalizer~=2.0.0 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from requests->pocoui) (2.0.12)
Requirement already satisfied: certifi>=2017.4.17 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from requests->pocoui) (2021.10.8)
Requirement already satisfied: cached-property~=1.5.1 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from facebook-wda>=1.3.3->airtest->pocoui) (1.5.2)
Requirement already satisfied: Deprecated~=1.2.6 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from facebook-wda>=1.3.3->airtest->pocoui) (1.2.13)
Requirement already satisfied: retry in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from facebook-wda>=1.3.3->airtest->pocoui) (0.9.2)
Requirement already satisfied: MarkupSafe>=2.0 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from Jinja2>=2.8->airtest->pocoui) (2.1.1)
Requirement already satisfied: wrapt<2,>=1.10 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from Deprecated~=1.2.6->facebook-wda>=1.3.3->airtest->pocoui) (1.14.0)
Requirement already satisfied: decorator>=3.4.2 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from retry->facebook-wda>=1.3.3->airtest->pocoui) (5.1.1)
Requirement already satisfied: py<2.0.0,>=1.4.26 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from retry->facebook-wda>=1.3.3->airtest->pocoui) (1.11.0)
Using legacy 'setup.py install' for pocoui, since package 'wheel' is not installed.
Using legacy 'setup.py install' for hrpc, since package 'wheel' is not installed.
Installing collected packages: websocket-client, hrpc, pocoui
  Running setup.py install for hrpc ... done
  Running setup.py install for pocoui ... done
Successfully installed hrpc-1.0.9 pocoui-1.0.87 websocket-client-0.48.0

再在终端执行pip3 list能看到pocoui即可。
在这里插入图片描述
参考链接:https://blog.csdn.net/weixin_49797392/article/details/118357639

  Python知识库 最新文章
Python中String模块
【Python】 14-CVS文件操作
python的panda库读写文件
使用Nordic的nrf52840实现蓝牙DFU过程
【Python学习记录】numpy数组用法整理
Python学习笔记
python字符串和列表
python如何从txt文件中解析出有效的数据
Python编程从入门到实践自学/3.1-3.2
python变量
上一篇文章      下一篇文章      查看所有文章
加:2022-05-08 08:03:10  更:2022-05-08 08:03:56 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/15 15:33:15-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码