Reputation: 87
I tried using pywinauto for python 2.7. The installation went as expected using pip. But when I try to import pywinauto package in python I following error:
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pywinauto
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pywinauto\__init__.py", line 40, in <module>
from . import findwindows
File "pywinauto\findwindows.py", line 39, in <module>
from . import win32functions
File "pywinauto\win32functions.py", line 216, in <module>
shcore = ctypes.windll.LoadLibrary(u"Shcore.dll")
File "D:\Program Files\python-2.7\lib\ctypes\__init__.py", line 440, in LoadLibrary
return self._dlltype(name)
File "D:\Program Files\python-2.7\lib\ctypes\__init__.py", line 362, in __init__
self._handle = _dlopen(self._name, mode)
TypeError: LoadLibrary() argument 1 must be string, not unicode
>>> import pywinauto
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pywinauto\__init__.py", line 40, in <module>
from . import findwindows
File "pywinauto\findwindows.py", line 39, in <module>
from . import win32functions
File "pywinauto\win32functions.py", line 35, in <module>
from . import win32defines, win32structures
ImportError: cannot import name win32defines
First import throws "TypeError: LoadLibrary() argument 1 must be string, not unicode" error whereas if I try to import it again it throws import error: "ImportError: cannot import name win32defines".
It would be helpful if anybody with more experience could help me out.
OS: win 10
python: 2.7.13
pywinauto: 0.6
Upvotes: 0
Views: 1325
Reputation: 26
Had similar issues in another module when I installed 2.7.13. Reverted to 2.7.12 (32bit on win 7 64bit) and the problem went away.
Upvotes: 1