Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to install the win32com module. I know I should download the Python for Windows extension, but it does not work.

After I have installed Python for Windows and try import win32com.client, I get the following error message:

>>> import win32com.client

    Traceback (most recent call last):
      File "<pyshell#2>", line 1, in <module>
        import win32com.client
      File "C:\Python27\lib\site-packages\win32com\__init__.py", line 5, in <module>
        import win32api, sys, os

ImportError: No module named win32api

Trying to google for help on how to install win32api for Python does not help either; I am just referred to the Python for Windows extensions again.

share|improve this question

migrated from stackoverflow.com Jun 19 '13 at 9:36

This question came from our site for professional and enthusiast programmers.

    
Did you install the right binary of Python for Windows extensions for your version of Python? For example, if you install 64-bit Python, then install the 32-bit extensions, the pure-Python modules (like win32con) will import, but the C-extension modules (like win32api) will not; if you install Python 2.6, then install the extensions for 2.7, they may import but crash later; etc. –  abarnert Jun 18 '13 at 21:00

2 Answers 2

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

share|improve this answer
    
Thanks for the advice. The problem turned out to be something different: for some reason there were two different Python installations in the registry, though both pointing to the same files. Re-installing it on both solved the problem. –  user2498747 Jun 19 '13 at 6:15

look for the file in your computer by searching in all your computer "win32api" once you find it put it here C:\Python26\Lib\win32com "this suppossed you already install win32com library and you will find the file I think in" C:\Python26\Lib\site-packages\win32 "After all the file should be located in those two places in your computer for your module to work that's it in fini".

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.