[python-win32] error importing win32com for Dispatch

Amelie Lesser amelie.lesser at googlemail.com
Tue Feb 1 11:31:25 CET 2011


 2011/1/31 Vernon Cole <vernondcole at gmail.com>

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

Ok, so I downloaded the pywin32-214.win32-py2.7.exe file (to go with the py
verion 2.7.1).

2011/1/31 Tim Roberts timr at probo.com
> That's not the right location.  Did you get and run the pywin32
> installer?  What command did you use to call "setup.py"?  In a properly
> installed system, win32com will live in
> \Python27\lib\site-packages\win32com.

I downloaded the exe file into C:\Python27 and am running it in the cmd or
by double-clicking. When I hit 'execute' it asks me whcih user to execute as
(I'm not the administrator, btu I read in the documentation that in this
build I should be able to install though I'm not admin) and whether I want
to protect the computer from unauthorised activities. If I check 'protect'
it'll say 'Runtime Error: Invalid directory name. Could not create temporary
file.' and 'Runtime error: Setup program invalid or damaged'. Elsif I
uncheck protect it will take me back in a loop over 'execute' to 'check
protect'.
I did ask our amin for help, but he crammed with work and has never used
python, so sadly gave up on it.


2011/1/31 Tim Roberts timr at probo.com
> Are you running a 32-bit system or a 64-bit system?  Did you install
> 32-bit Python or 64-bit Python?

I'm running a Windows XP pro 2002. I think it's 32bits (running 'winver' the
product name doesn't list '64 bit'). I'm relatively sure that the python is
32-bit, too (our system admin installed it), but I'm not sure how to confirm
that. It's Python 2.7.1





2011/1/31 Vernon Cole <vernondcole at gmail.com>

> 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. 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/20110201/2ffab0a6/attachment.html>


More information about the python-win32 mailing list