0


For a project in python I need both the pyHook and pywin32 modules.
I installed them by downloading the .whl files for them and installing them with pip.
But when I try to import them in my project they can not be found.

This is the error I get:

Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Program Files\JetBrains\PyCharm Community Edition 
2018.3.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'pyHook'

For some reason I can import pyHook in IDLE but pywin32 doesn't work in IDLE or pycharm

when I use the command 'pip list' in cmd the two modules are listed.

maybe this could be usefull:

os.path
<module 'ntpath' from 
'C:\\Users\\dellSebastiaan\\AppData\\Local\\Programs\\Python\\Python37- 
32\\lib\\ntpath.py'>


for p in sys.path:
print(p)

C:\Users\dellSebastiaan\AppData\Local\Programs\Python\Python37-32\Lib\idlelib
C:\Users\dellSebastiaan\AppData\Local\Programs\Python\Python37-32\python37.zip
C:\Users\dellSebastiaan\AppData\Local\Programs\Python\Python37-32\DLLs
C:\Users\dellSebastiaan\AppData\Local\Programs\Python\Python37-32\lib
C:\Users\dellSebastiaan\AppData\Local\Programs\Python\Python37-32
C:\Users\dellSebastiaan\AppData\Local\Programs\Python\Python37-32\lib\site-packages
C:\Users\dellSebastiaan\AppData\Local\Programs\Python\Python37-32\lib\site- 
packages\win32
C:\Users\dellSebastiaan\AppData\Local\Programs\Python\Python37-32\lib\site- 
packages\win32\lib
C:\Users\dellSebastiaan\AppData\Local\Programs\Python\Python37-32\lib\site- 
packages\Pythonwin


Thank you for your help.

1 Answers1

1

If you have not tried, you should uninstall and reinstall the modules with pip uninstall and pip install. Also, you might want to try pip3.

Also, check your python version. Your modules may not work if you use 3.7. Try to do this with 3.6.

Jack H.
  • 115
  • 10