jithurjacob / Windows-10-Toast-Notifications

Python library to display Windows 10 Toast Notifications
MIT License
970 stars 168 forks source link

Error With Importing Win32Api #62

Closed JaffaKetchup closed 4 years ago

JaffaKetchup commented 4 years ago

Hello!

I am getting an error when trying to import this into my project:

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    from win10toast import ToastNotifier
  File "C:\Users\Luka\AppData\Roaming\Python\Python38\site-packages\win10toast\__init__.py", line 19, in <module>
    from win32api import GetModuleHandle
ModuleNotFoundError: No module named 'win32api'

It seems win32api is missing. So I go ahead and install it with this command: python -m pip install win32api --user. I have to use --user as I am not an admin on my PC. The following error occurs...

ERROR: Could not find a version that satisfies the requirement win32api (from versions: none)
ERROR: No matching distribution found for win32api

So I try: python -m pip install pypiwin32 --user, as this is listed in requirements section. I already have it. I am using Python 3.8.0 and IDLE, on a Windows 10 PC.

So what am I doing wrong? Thanks!

nuno-andre commented 4 years ago

pypiwin32 is an outdated package created by the same author to provide wheels. The only currently maintained package is pywin32.

python -m pip install pywin32 --user
JaffaKetchup commented 4 years ago

Hello! Thanks for the reply! I already have this package installed on my system, however.

Anthony6444 commented 4 years ago

pip3 install pywin32

JaffaKetchup commented 4 years ago

Thanks again for replying! So just running pip3, I get the following error:

Traceback (most recent call last):
  File "c:\program files\python38\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\program files\python38\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Python38\Scripts\pip3.exe\__main__.py", line 9, in <module>
TypeError: 'module' object is not callable

Do you have any idea what this means? Thanks so much!

Anthony6444 commented 4 years ago

Try pip3 install --upgrade pip then pip3 install pywin32.

JaffaKetchup commented 4 years ago

Thanks for the quick reply! However, just running pip3 causes the above error, using python -m pip does work. It is on the latest update. Don't worry, I have found another library to do this, but thanks for the great help & support, and I'll leave a star on this project! Thanks, All the best.