[python-win32] error importing win32com for Dispatch

Vernon Cole vernondcole at gmail.com
Mon Jan 31 20:10:39 CET 2011


Don't use the ZIP file. It is a pain to install, and (as you see) sometimes
does not install correctly. Unfortunately, sourceforge sets it as the
default thing to do.  What you want to do is push  the "view all files"
button <http://sourceforge.net/projects/pywin32/files/pywin32/> and select
the latest Windows installer for the version of Python you are running.
(also note that even if you are running a 64 bit version of Windows, you
should probably select a 32 bit version of Python.)
--
Vernon


On Mon, Jan 31, 2011 at 7:41 AM, Amelie Lesser <amelie.lesser at googlemail.com
> wrote:

> Hello Group,
>
> I am struggling very hard with using the win32com.client to use Dispatch.
> I've been looking around quite a lot, but couldn't find any help that solved
> my problem. I only started working with python 2 months ago, so I am still
> quite the newbie.
>
> I'm working on a python script that is supposed to read a database into a
> list. It then should take certain information from each data entry, plug
> them into an excel file, let excel do a rather complex calculation using
> macros, and append the results from certain cells back to the list.
> I am working on Windows using the python IDLE shell and also tried it in
> gedit running the file on the cmd line.
>
> I downloaded the pywin32 extension from
> http://sourceforge.net/projects/pywin32/ and ran the setup.py file.
> The program starts with:
>
> *from win32com.client import Dispatch
> *
> For which I receive the following Error message:
>
> *Traceback (most recent call last):
>   File "Z:\testpython\dbf_converter\testing.py", line 3, in <module>
>     from win32com.client import Dispatch
> ImportError: No module named win32com.client*
>
>
>    - I read through the Installation Problems on
>    http://starship.python.net/~skippy/win32/InstallationProblems.html<http://starship.python.net/%7Eskippy/win32/InstallationProblems.html>.
>    I found that I do have two versions of the python27.dll file, and deleted
>    the one in the C:\Python27 directory, but everytime I start IDLE it
>    re-creates that file.
>    - I also tried setting the path using (separately) ...but no
>    difference.
>       - *sys.path.append('C:\\WINDOWS\\system32\\')*
>       - *sys.path.append('C:\\Python27\\pywin32-214\\pywin32-214\\com')*
>    - I tried deleting and reinstalling the extension
>
>
> I am completely lost and would really appreciate any help.
>
> Amelie
>
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20110131/73df0b9e/attachment-0001.html>


More information about the python-win32 mailing list