0

I'm trying to send a image in WhatsApp through pywhatkit module, but when I run my code I have the error ModuleNotFoundError: No module named 'win32clipboard'.

I installed pywin32, but the error remains. Here's my code:

import pywhatkit as w

w.sendwhats_image('NUMBER', 'C:\\THIS\\IS\\MY\\FOLDER\\pic.png', 'CAPTION')

And this is where the error triggers (filename 'core.py' from pywhatkit module):

from io import BytesIO

import win32clipboard
from PIL import Image

image = Image.open(path)
output = BytesIO()
image.convert("RGB").save(output, "BMP")
data = output.getvalue()[14:]
output.close()
win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardData(win32clipboard.CF_DIB, data)
win32clipboard.CloseClipboard()
  • Did you install the module? [This](https://stackoverflow.com/questions/15310121/trying-to-install-module-win32clipboard#:~:text=For%20those%20still%20here%207%20years%20later) might help – Hytrax Mar 24 '23 at 14:05
  • Looking at [the current source code](https://github.com/Ankit404butfound/PyWhatKit/blob/e5b7c7bc0ba30d3f42369d76d19e5c2a7bcb962a/pywhatkit/core/core.py#L132) the line is `import win32clipboard # pip install pywin32`. Note the comment. It looks like this package `pywhatkit` is not very well developed in respect of installing dependecies – buran Mar 24 '23 at 14:11

1 Answers1

0

Go to cmd and execute the following command pip install pywin32

Ajay S
  • 29
  • 4
  • I appreciate the answer of all. I uninstalled and installed pywin32 a few times and that solved the problem. As Buran mentioned, pywhatkit is not well developed when it comes to installing dependencies. Thanks to all of you! – lucasniveous Mar 24 '23 at 14:34