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, 成功了!


import pywinauto
# Generating comtypes.gen._944DE083_8FB8_45CF_BCB7_C477ACB2F897_0_1_0
# Generating comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0
# Generating comtypes.gen.stdole
# Generating comtypes.gen.UIAutomationClient
pywinauto.__version__
Out[3]: '0.6.2'

C:\Documents and Settings\Administrator>pip install --upgrade pywinauto
Collecting pywinauto
Downloading pywinauto-0.6.2-1.zip (505kB)
100% |████████████████████████████████| 512kB 435kB/s
Requirement already up-to-date: six in d:\anaconda2\lib\site-packages (from pywinauto)
Collecting comtypes (from pywinauto)
Downloading comtypes-1.1.3-2.zip (179kB)
100% |████████████████████████████████| 184kB 544kB/s
Building wheels for collected packages: pywinauto, comtypes
Running setup.py bdist_wheel for pywinauto ... done
Stored in directory: C:\Documents and Settings\Administrator\Local Settings\Application Data\pip\Cache\wheels\48\f2\cf\549b15f185bc4e9fedafda46cbb24aa0eeb8289cfa999bf378
Running setup.py bdist_wheel for comtypes ... done
Stored in directory: C:\Documents and Settings\Administrator\Local Settings\Application Data\pip\Cache\wheels\16\4a\80\7e3d966317021cdf84659f0661887daf4266d33062378c1fc1
Successfully built pywinauto comtypes
Installing collected packages: comtypes, pywinauto
Found existing installation: comtypes 1.1.2
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.
Uninstalling comtypes-1.1.2:
Successfully uninstalled comtypes-1.1.2
Found existing installation: pywinauto 0.5.4
Uninstalling pywinauto-0.5.4:
Successfully uninstalled pywinauto-0.5.4
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. ADT队列/FIFO表

    队列是一种特殊的表,只在表首进行删除,只在表尾进行插入,按照先进先出原则操作(First In First Out),又称为FIFO表: 队列的指针实现代码: #include<cstdio&g ...

  2. 第三章 深入Servlet技术

    3.1 配置Servlet <servlet-name>,<servlet-class>是必须配置的,以便于web容器知道浏览器具体访问的是哪个servlet. <ini ...

  3. T4模板_入门

    T4模板作为VS自带的一套代码生成器,功能有多强大我也不知道,最近查找了一些资料学习一下,做个笔记 更详细的资料参见: MSDN: http://msdn.microsoft.com/zh-cn/li ...

  4. Docker使用阿里云镜像加速

    1.进入阿里云镜像加速页面: https://cr.console.aliyun.com/#/accelerator 2.修改/etc/docker/daemon.json文件配置,没有则新建: { ...

  5. IPV6 简单验证

    1. 网络路由器的分类 .通常将网络中直接面向用户连接或访问网络的部分称为接入层,接入层目的是允许终端用户连接到网络,因此接入层交换机具有低成本和高端口密度特性: .将位于接入层和核心层之间的部分称为 ...

  6. (转)web性能优化

    前端是庞大的,包括 HTML. CSS. Javascript.Image .Flash等等各种各样的资源.前端优化是复杂的,针对方方面面的资源都有不同的方式.那么,前端优化的目的是什么 ? 1. 从 ...

  7. sql 设计规范

    设计规范: 1.采用有意义的字段名 尽可能地把字段描述的清楚些.当然,也别做过头了,比如CustomerShippingAddressStreetLine1虽然很富有说明性,但没人愿意键入这么长的名字 ...

  8. [OS] Linux进程、线程通信方式总结

    转自:http://blog.sina.com.cn/s/blog_64b9c6850100ub80.html Linux系统中的进程通信方式主要以下几种: 同一主机上的进程通信方式 * UNIX进程 ...

  9. python自动化之word文档

    #########################docx文件############################ ''' .docx文件有很多结构,有3种不同的类型来表示 在最高一层,Docum ...

  10. php 关于文件夹的一些封装好的函数

    /** *检测文件名是否合法 * @param string $filename * @return boolean */ function checkFilename($filename){ $pa ...