Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't run pywin32 post install

Tags:

python

pywin32

I'm trying to use winpexpect on windows 7 64 bit on an AMD processor. For this, I installed pywin32, the executable called pywin32-214.win-amd64-py2.7. The graphical installer seemed to run successfully, but I get this error when I try to import winpexpect:

>>> import winpexpect
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Alexei\wordseer_flask\venv\lib\site-packages\winpexpect.py", li
ne 11, in <module>
    import pywintypes
  File "C:\Users\Alexei\wordseer_flask\venv\lib\site-packages\pywin32-214-py2.7-
win32.egg\pywintypes.py", line 124, in <module>
    __import_pywin32_system_module__("pywintypes", globals())
  File "C:\Users\Alexei\wordseer_flask\venv\lib\site-packages\pywin32-214-py2.7-
win32.egg\pywintypes.py", line 64, in __import_pywin32_system_module__
    import _win32sysloader
ImportError: DLL load failed: %1 is not a valid Win32 application.

When I try to run C:\Python27\Scripts\pywin32_postinstall:

C:\Windows\system32>C:\Python27\Scripts\pywin32_postinstall.py -install
Traceback (most recent call last):
  File "C:\Python27\Scripts\pywin32_postinstall.py", line 601, in <module>
    install()
  File "C:\Python27\Scripts\pywin32_postinstall.py", line 311, in install
    LoadSystemModule(lib_dir, "pywintypes")
  File "C:\Python27\Scripts\pywin32_postinstall.py", line 149, in LoadSystemModu
le
    ('.dll', 'rb', imp.C_EXTENSION))
ImportError: DLL load failed: %1 is not a valid Win32 application.
like image 339
Plasma Avatar asked Nov 22 '22 14:11

Plasma


1 Answers

When I installed pyinstaller, I also got the same error: import _win32sysloader ImportError: DLL load failed: The specified module could not be found. Installing Microsoft Visual C++ 2010 Redistributable Package fixed the error.

like image 188
zijian sheng Avatar answered Dec 18 '22 09:12

zijian sheng