Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No module named 'win32api'

In Python 3.4 from Anaconda, I created a program and it is giving me and import error each time I run it. Using Spyder.

ImportError: No module named 'win32api'

I already have the pywin32 installed. And I can see the win32api.pyd under C:\Anaconda3\Lib\site-packages\win32

This is the import code on my program:

from tkinter import *
from tkinter import ttk
import tkinter.messagebox
import time
import requests #needs to be installed
import pymysql #needs to be installed
import csv 
import win32com.client #needs to be installed

import datetime

This is the whole error:

File "C:\Anaconda3\lib\site-packages\win32com\__init__.py", line 5, in <module>
import win32api, sys, os

ImportError: No module named 'win32api'

This is the only instance of Python I have installed. I uninstalled everything else and installed only Anaconda.

Searching online I got to something that said that it could be a problem with the PYTHONPATH. But honestly, I have no idea what they are talking about. So any noob help would be really appreciated. I am using Windows 7 by the way.

Thank you

like image 338
Alvaro Morales Solis Avatar asked Aug 14 '14 17:08

Alvaro Morales Solis


2 Answers

I had the same problem and solved it installing the module pywin32:

In a normal python:

pip install pywin32

In anaconda:

conda install pywin32

My python installation (Intel® Distribution for Python) had some kind of dependency problem and was giving this error. After installing this module I never more saw it.

like image 114
neves Avatar answered Oct 13 '22 09:10

neves


This should work:

pip install pypiwin32
like image 34
Dr. Div Avatar answered Oct 13 '22 10:10

Dr. Div