ImportError: No module named pywintypes

后端 未结 6 1542
再見小時候
再見小時候 2020-12-15 23:10

I am working to make a small keylogger with Python, by using the pyHook, pythoncom and Pywin32 modules. Here is my code:

import pyHook, pythoncom, sys, loggi         


        
相关标签:
6条回答
  • 2020-12-15 23:12

    pywintypes is part of the Python for Windows extensions, otherwise known as pywin32. You'll need to install that to get access to pywintypes.

    Note that as of this writing, pywin32's maintainer doesn't upload files to PyPI, so you have to get an appropriate version of installer from http://pywin32.sf.net.

    0 讨论(0)
  • 2020-12-15 23:14

    I have had this error when trying to create a python service using pywin32 module. I copied pythoncom38.dll and pywintypes38.dll into the root directory of the project and it solved the issue.

    0 讨论(0)
  • 2020-12-15 23:21

    I know my answer is bit late but just run to this problem. Both pywin32 and pypiwin32 is installed on my virtualenv, my app is working fine during test. When I run pyinstaller to build my exe, this error showed up.

    Solution: I needed to install (through pip) pywin32 and pypiwin32 on my base python env ( not the virtualenv) for pyinstaller to build my exe.

    0 讨论(0)
  • 2020-12-15 23:32

    Just add pythoncom34.dll and pywintypes34.dll to your C:\Python34\

    0 讨论(0)
  • 2020-12-15 23:33

    For me it worked to copy the files (pythoncom38.dll and pywintypes38.dll) from:

    C:\Users\"Your user id"\AppData\Roaming\Python\Python38\site-packages\pywin32_system32
    

    To the path:

    C:\Users\"Your user id"\AppData\Roaming\Python\Python38\site-packages\win32\lib
    

    and

    C:\Users\"Your user id"\AppData\Roaming\Python\Python38\site-packages\win32
    
    • After installation of Visual Studio, I need sometimes to restart computer after copy the files.
    0 讨论(0)
  • 2020-12-15 23:34

    pip install pypiwin32 worked for me

    0 讨论(0)
提交回复
热议问题