• 【python自动化】01.安装配置库和环境之win32gui安装失败(保姆级图文)



    『python自动化』分享win32gui、cv2、easyocr等库相关的新手入门教程,目标是编写python程序进行自动化办公,解放双手。

    欢迎关注 『python自动化』 系列,持续更新中
    欢迎关注 『python自动化』 系列,持续更新中

    我是在独立的项目虚拟环境中安装配置各个库,其他的库基本上都能pip install解决,只有在安装win32gui库的时候遇到了困难,

    报错效果

    在这里插入图片描述

    Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
    Collecting win32gui
      Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b8/75/7bed82934e51903f9d48b26b3996161bb2dce1731607b4bb7fd26003ed3e/win32gui-221.5.tar.gz (605 kB)
      Installing build dependencies ... done
      Getting requirements to build wheel ... error
      error: subprocess-exited-with-error
    
      × Getting requirements to build wheel did not run successfully.
      │ exit code: 1
      ╰─> [19 lines of output]
          Traceback (most recent call last):
            File "e:\allworkspace\python work space\python纯图色脚本\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
              main()
            File "e:\allworkspace\python work space\python纯图色脚本\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
              json_out['return_val'] = hook(**hook_input['kwargs'])
            File "e:\allworkspace\python work space\python纯图色脚本\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 130, in get_requires_for_build_wheel
              return hook(config_settings)
            File "C:\Users\ASUS\AppData\Local\Temp\pip-build-env-5gya8ave\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in get_requires_for_build_wheel
              return self._get_build_requires(config_settings, requirements=['wheel'])
            File "C:\Users\ASUS\AppData\Local\Temp\pip-build-env-5gya8ave\overlay\Lib\site-packages\setuptools\build_meta.py", line 320, in _get_build_requires
              self.run_setup()
            File "C:\Users\ASUS\AppData\Local\Temp\pip-build-env-5gya8ave\overlay\Lib\site-packages\setuptools\build_meta.py", line 482, in run_setup
              super(_BuildMetaLegacyBackend,
            File "C:\Users\ASUS\AppData\Local\Temp\pip-build-env-5gya8ave\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
              exec(code, locals())
            File "", line 27, in <module>
            File "C:\Users\ASUS\AppData\Local\Temp\pip-install-kiw84dvk\win32gui_712b634add45492f8cc5b815a960773e\win32\distutils\gui.py", line 6, in <module>
              from .command import win32_build_ext
          ModuleNotFoundError: No module named 'win32.distutils.command'
          [end of output]
    
      note: This error originates from a subprocess, and is likely not a problem with pip.
    error: subprocess-exited-with-error
    
    × Getting requirements to build wheel did not run successfully.
    │ exit code: 1
    ╰─> See above for output.
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39

    解决方法

    安装win32库(到这里其实就能用,下面的2点是不想飘红)

    这里安装pywin32库就可以使用win32gui等库,我一开始还想直接安装win32gui,卡住了半天。

    在这里插入图片描述

    不要在项目路径中出现中文(基本上到这一步就能解决问题)

    强调!!!PyCharm里的项目和路径最好不要包含中文!!!
    在这里插入图片描述

    没有飘红
    在这里插入图片描述


    总结

    大家喜欢的话,给个👍,点个关注!给大家分享更多有趣好玩的python自动化办公知识!

    版权声明:

    发现你走远了@mzh原创作品,转载必须标注原文链接

    Copyright 2022 mzh

    Crated:2022-8-1

    欢迎关注 『python自动化』 系列,持续更新中
    欢迎关注 『python自动化』 系列,持续更新中

    【更多内容敬请期待】


  • 相关阅读:
    java基于微信小程序的在线学习考试系统 uniapp 小程序
    尚好房 02_用户角色管理
    【带RL负载的全波桥式整流器】功能齐全的单相非控整流器(Simulink)
    uniapp音乐播放整理
    研究生有限元仿真应用中存在的问题与对策
    内存 分页、交换空间
    算法套路学习笔记(第二章) 动态规划系列 2.13-2.19
    Cobbler 搭建方法
    《C Primer Plus》第12章复习题与编程练习
    如何使用无代码系统搭建软件平台?有哪些开源无代码开发平台?
  • 原文地址:https://blog.csdn.net/u011027547/article/details/126450109