pywinauto: 导入时遇到 "TypeError: LoadLibrary() argument 1 must be string, not unicode"

  • 经查询, 看到了同样的问题, 在stackoverflow上面,

pywinauto import error for python 2.7 - Stack Overflow

http://stackoverflow.com/questions/41653306/pywinauto-import-error-for-python-2-7

  • 按照帖子里的回答, 问题出在: python 2.7.13里的ctypes模块有了新的变化. 解决办法是

    1. 要么降级到python 2.7.12里
    2. 要么升级pywinauto到0.6.1以上.
  • 我选择第二种方案.

upgrade pywinauto to 0.6.2 from 0.5

之后, 导入pywinauto, 成功了!


  1. import pywinauto
  2. # Generating comtypes.gen._944DE083_8FB8_45CF_BCB7_C477ACB2F897_0_1_0
  3. # Generating comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0
  4. # Generating comtypes.gen.stdole
  5. # Generating comtypes.gen.UIAutomationClient
  6. pywinauto.__version__
  7. Out[3]: '0.6.2'

  1. C:\Documents and Settings\Administrator>pip install --upgrade pywinauto
  2. Collecting pywinauto
  3. Downloading pywinauto-0.6.2-1.zip (505kB)
  4. 100% |████████████████████████████████| 512kB 435kB/s
  5. Requirement already up-to-date: six in d:\anaconda2\lib\site-packages (from pywinauto)
  6. Collecting comtypes (from pywinauto)
  7. Downloading comtypes-1.1.3-2.zip (179kB)
  8. 100% |████████████████████████████████| 184kB 544kB/s
  9. Building wheels for collected packages: pywinauto, comtypes
  10. Running setup.py bdist_wheel for pywinauto ... done
  11. Stored in directory: C:\Documents and Settings\Administrator\Local Settings\Application Data\pip\Cache\wheels\48\f2\cf\549b15f185bc4e9fedafda46cbb24aa0eeb8289cfa999bf378
  12. Running setup.py bdist_wheel for comtypes ... done
  13. Stored in directory: C:\Documents and Settings\Administrator\Local Settings\Application Data\pip\Cache\wheels\16\4a\80\7e3d966317021cdf84659f0661887daf4266d33062378c1fc1
  14. Successfully built pywinauto comtypes
  15. Installing collected packages: comtypes, pywinauto
  16. Found existing installation: comtypes 1.1.2
  17. DEPRECATION: Uninstalling a distutils installed project (comtypes) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
  18. Uninstalling comtypes-1.1.2:
  19. Successfully uninstalled comtypes-1.1.2
  20. Found existing installation: pywinauto 0.5.4
  21. Uninstalling pywinauto-0.5.4:
  22. Successfully uninstalled pywinauto-0.5.4
  23. Successfully installed comtypes-1.1.3 pywinauto-0.6.2

pywinauto: 导入时遇到 "TypeError: LoadLibrary() argument 1 must be string, not unicode"的更多相关文章

  1. statsmodels.tsa.arima_model预测时报错TypeError: int() argument must be a string, a bytes-like object or a number, not 'Timestamp'

    在 python 中用 statsmodels创建 ARIMA 模型进行预测时间序列: import pandas as pd import statsmodels.api as sm df = pd ...

  2. TypeError: Fetch argument 0.484375 has invalid type <class 'numpy.float32'>, must be a string or Tensor. (Can not convert a float32 into a Tensor or Operation.)

    报错: TypeError: Fetch argument 0.484375 has invalid type <class 'numpy.float32'>, must be a str ...

  3. 关于TypeError: strptime() argument 1 must be str, not bytes解析

    关于TypeError: strptime() argument 1 must be str, not bytes解析   在使用datetime.strptime(s,fmt)来输出结果日期结果时, ...

  4. moviepy音视频剪辑:headblur函数遇到的TypeError: integer argument expected, got float错误的解决方案

    运行环境如下: python版本:3.7 opencv-python版本:4.2.0.34 numpy版本:1.19.0 错误信息: 在调用moviepy1.03版本的headblur函数执行人脸跟踪 ...

  5. Python super(Todo,self).__init__() TypeError: super() argument 1 must be type, not classobj

    示例如下 class A(): def __init__(self):pass class B(A): def __init__(self): super(A, self).__init__() 当调 ...

  6. Python包的相对导入时出现错误的解决方法

    在练习Python中package的相对导入时,即 from . import XXX 或者 from .. import XXX 时会遇到这样两个错误: SystemError: Parent mo ...

  7. python使用rrdtool时 argument 0 must be string的问题

    在updatev rrdfile时, ret = rrdtool.updatev(filename, ds) 报了argument 0 must be string的异常,经查是因为python 的r ...

  8. oracle导入时提示IMP-00010:不是有效的导出文件,头部验证失败

    oracle导入时提示IMP-00010:不是有效的导出文件,头部验证失败: 原因分析:导出的oracle的版本与导入的oracle数据库的版本不一致: 可直接将dmp文件用notepad++打开修改 ...

  9. TypeError: Fetch argument 0 has invalid type <type 'int'>, must be a string or Tensor. (Can not convert a int into a Tensor or Operation.)

    6月5日的時候,修改dilated_seg.py(使用tensorflow)出現了報錯: TypeError: Fetch argument 0 has invalid type <type ' ...

随机推荐

  1. SQL Server查询已锁的表及解锁

    --查询已锁的表 select request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName ,* from ...

  2. OSG学习:计算纹理坐标

    在很多时候,直接指定纹理坐标是非常不方便的,如曲面纹理坐标,只有少数的曲面(如圆锥.圆柱等)可以在不产生扭曲的情况下映射到平面上,其他的曲面在映射到表面时都会产生一定程度的扭曲.一般而言,曲面表面的曲 ...

  3. 微信小程序入门一: 简易form、本地存储

    实例内容 登陆界面 处理登陆表单数据 处理登陆表单数据(异步) 清除本地数据 实例一: 登陆界面 在app.json中添加登陆页面pages/login/login,并设置为入口. 保存后,自动生成相 ...

  4. Linux下更改正确国内时间

    Linux使用小Tips 整理些Linux些常遇到的问题. Linux下设置时间 提供两种最根本有效的方式,就是更改时区.这里以更改为国内上海时间例子,其他地方时区同理. 方法一 备份文件 mv /e ...

  5. L2 L3 L4

    第二层交换机,是根据第二层数据链路层的MAC地址和通过站表选择路由来完成端到端的数据交换的.因为站表的建立与维护是由交换机自动完成,而路由器又是属于第三层设备,其寻址过程是根据IP地址寻址和通过路由表 ...

  6. Dubbo学习(五) Dubbo 从下载到编译成功

    DUBBO是一个分布式服务框架,致力于提供高性能和透明化的RPC远程服务调用方案,是阿里巴巴SOA服务化治理方案的核心框架,每天为2,000+个服务提供3,000,000,000+次访问量支持,并被广 ...

  7. BZOJ4561 JLOI2016圆的异或并(扫描线+平衡树)

    考虑一条扫描线从左到右扫过这些圆.观察某一时刻直线与这些圆的交点,可以发现构成一个类似括号序列的东西,括号的包含关系与圆的包含关系是相同的.并且当扫描线逐渐移动时,括号间的相对顺序不变.于是考虑用se ...

  8. Google题解

    Kickstart2017 RoundB B.题意: 二维平面上有n个点, 每个点坐标(xi, yi), 权值wi, 问: 在平面上找一点p, 使得 Σwi*max(|X-xi|, |Y-yi|)最小 ...

  9. Navicat使用教程:获取MySQL中的高级行数(第2部分)

    Navicat Premium是一个可连接多种数据库的管理工具,它可以让你以单一程序同时连接到MySQL.Oracle及PostgreSQL数据库,让管理不同类型的数据库更加的方便. 在上篇文章中,我 ...

  10. Web前端开发神器--WebStorm(JavaScript 开发工具) 8.0.3 中文汉化破解版

    WebStorm(JavaScript 开发工具) 8.0.3 中文汉化破解版 http://www.jb51.net/softs/171905.html WebStorm 是jetbrains公司旗 ...