9

I already installed the "Python for Windows extensions" library from here:

http://sourceforge.net/projects/pywin32/files/pywin32/

but when I import the "win32com.client" in my program, I still got the error message:

ImportError: No module named win32com.client

My Python version is 3.2.

Any ideas?

Alex Kulinkovich
  • 4,408
  • 15
  • 46
  • 50
Bingnan
  • 89
  • 1
  • 1
  • 4
  • check the paths to libraries, find out where it has been installed and can python find it (right now it can't) – bua Nov 02 '11 at 10:06
  • Follow @Nicola 's suggestion,I add "win32com" into the pywin32.pth file under the _site-packages_ of (Python3.2),but my program still can not find it. My system have multi-version of Python (Python2.5,Python3.1,Python3.2),I set Python3.2 into the _WINDOWS Environment variables_ , so when I check **sys.path** under the PYTHON SHELL, it show the environment is Python3.2, but if I write `import sys print (sys.path)` in a .py file and run it, it will show the environment is Python2.5. I don't know why they are different. – Bingnan Nov 03 '11 at 03:57
  • 2
    But finally, I resolve this problem by indicating the specific version of python.exe. for example, I run my .py file like this `c:\Python32\python.exe test.py` – Bingnan Nov 03 '11 at 04:00
  • [\[SO\]: ImportError: No module named win32com.client (@CristiFati's answer)](https://stackoverflow.com/a/75310161/4788546) – CristiFati Feb 02 '23 at 09:38

3 Answers3

1

I faced the same problem while using Visual Studio. The following fixed the issue: 1. Right Click Project Properties (in the Solution Explorer window) 2. Select Properties 3. In the General Tab set the appropriate Interpreter (Python2.7 in this case)

enter image description here

0

Check sys.path to make sure the directory where the module is installed is in there, otherwise you have to add it (google PYTHONPATH windows for some help with that.)

Some programmer dude
  • 400,186
  • 35
  • 402
  • 621
0

For some reason win32com is not included in pywin32.pth under site-packages. You might try and add it there, but this post about Movable Python makes me think that the problem is a bit more complicated.

Nicola Musatti
  • 17,834
  • 2
  • 46
  • 55