pywinauto: 导入时遇到 "TypeError: LoadLibrary() argument 1 must be string, not unicode"
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模块有了新的变化. 解决办法是
- 要么降级到python 2.7.12里
- 要么升级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"的更多相关文章
- 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 ...
- 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 ...
- 关于TypeError: strptime() argument 1 must be str, not bytes解析
关于TypeError: strptime() argument 1 must be str, not bytes解析 在使用datetime.strptime(s,fmt)来输出结果日期结果时, ...
- moviepy音视频剪辑:headblur函数遇到的TypeError: integer argument expected, got float错误的解决方案
运行环境如下: python版本:3.7 opencv-python版本:4.2.0.34 numpy版本:1.19.0 错误信息: 在调用moviepy1.03版本的headblur函数执行人脸跟踪 ...
- 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__() 当调 ...
- Python包的相对导入时出现错误的解决方法
在练习Python中package的相对导入时,即 from . import XXX 或者 from .. import XXX 时会遇到这样两个错误: SystemError: Parent mo ...
- python使用rrdtool时 argument 0 must be string的问题
在updatev rrdfile时, ret = rrdtool.updatev(filename, ds) 报了argument 0 must be string的异常,经查是因为python 的r ...
- oracle导入时提示IMP-00010:不是有效的导出文件,头部验证失败
oracle导入时提示IMP-00010:不是有效的导出文件,头部验证失败: 原因分析:导出的oracle的版本与导入的oracle数据库的版本不一致: 可直接将dmp文件用notepad++打开修改 ...
- 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 ' ...
随机推荐
- mysql 随机获取一条或多条数据
若要在i ≤r≤ j 这个范围得到一个随机整数r ,需要用到表达式 FLOOR( RAND() * (j – i)+i),RLOOR()取整树部分,RAND()生成0~1的随机数.ROUND(x,n) ...
- Go 自学笔记
1. 最近花时间简单自学了一下go语言的语法..为了保证自己不是每次从0 开始 这次简单进行一下记录 保证 学习 效果. 2. 安装 直接下载go的包 进行安装 以及 暗转goland2018.3 进 ...
- 从解决一个java.lang.NoSuchMethodError想到的
今天在发布系统部署一个web app的时候,发现应用服务器(tomcat 7.0.26)不能正常启动,于是远程登陆到服务器上查看应用服务器的启动日志,在tomcat_home的logs/localho ...
- mysql索引的优化
MySQL索引的优化 上面都在说使用索引的好处,但过多的使用索引将会造成滥用.因此索引也会有它的缺点:虽然索引大大提高了查询速度,同时却会降低更新表的速度,如对表进行INSERT.UPDATE和DEL ...
- Redis (二)_ jedis的使用
Jedis 是 Redis 官方首选的 Java 客户端开发包 虚拟机设置 查看虚拟机的ip ifconfig 将虚拟机的6379端口打开 #运行下面的命令 如果是新建的一个新的 文件,你需要先安装 ...
- Dubbo学习(二) Dubbo 集群容错模式-负载均衡模式
Dubbo是Alibaba开源的分布式服务框架,我们可以非常容易地通过Dubbo来构建分布式服务,并根据自己实际业务应用场景来选择合适的集群容错模式,这个对于很多应用都是迫切希望的,只需要通过简单的配 ...
- 【HLSDK系列】groupinfo的基本用法
如果你经常写AMXX,你应该会知道有个 pev->groupinfo 变量,但我猜大部分人都不会用这个变量,这个变量涉及很多实体处理功能,下面列举几个最常用的. ① 玩家与非玩家实体之间的碰撞检 ...
- Visual Categorization with Bags of Keypoints
1.Introduction and backgrounds 作为本周的论文之一,这是一篇bag of features的基本文章之一,主要了解其中的基本思路,以及用到的基本技术,尽量使得细节更加清楚 ...
- Day24-图片验证码----待续
一,上课所讲---------没听懂!!! 1,首先,图片验证码不能放到客户浏览器的cookie上,否则,客户可以直接从它的浏览器上拿到,然后自动提交,这样的话,验证码就没有任何用处了.所以图片验证码 ...
- BZOJ 2460: [BeiJing2011]元素
2460: [BeiJing2011]元素 Time Limit: 20 Sec Memory Limit: 128 MBSubmit: 878 Solved: 470[Submit][Statu ...