Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

ModuleNotFoundError: No module named 'win32clipboard'

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):

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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()

>Solution :

Go to cmd and execute the following command pip install pywin32

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading