472,353 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

COM makepy broken in ActivePython 2.3.2?

I have problems getting "COM makepy" working in ActivePython 2.3.2.
This is what happens when I start "COM makepy" from the Pythonwin
Menu:

PythonWin 2.3.2 (#49, Nov 6 2003, 10:18:20) [MSC v.1200 32 bit
(Intel)] on win32.
Portions Copyright 1994-2001 Mark Hammond (mh******@skippinet.com.au)
- see 'Help/About PythonWin' for further copyright information.
Failed to execute command:

from win32com.client import makepy;makepy.main()
Traceback (most recent call last):
File
"C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\toolmenu.py",
line 103, in HandleToolCommand
exec "%s\n" % pyCmd
File "<string>", line 1, in ?
File "C:\Python23\Lib\site-packages\win32com\client\__init__.py",
line 12, in ?
import dynamic, gencache, pythoncom
File "C:\Python23\Lib\site-packages\win32com\client\gencache.py",
line 623, in ?
__init__()
File "C:\Python23\Lib\site-packages\win32com\client\gencache.py",
line 52, in __init__
Rebuild()
File "C:\Python23\Lib\site-packages\win32com\client\gencache.py",
line 610, in Rebuild
_SaveDicts()
File "C:\Python23\Lib\site-packages\win32com\client\gencache.py",
line 57, in _SaveDicts
raise RuntimeError, "Trying to write to a readonly gencache
('%s')!" \
RuntimeError: Trying to write to a readonly gencache
('C:\TEMP\gen_py\2.3')!
---------------------------------------------------

OK, so I figure it wants to write to C:\TEMP\gen_py (why? IIRC this
used to be buried somewhere along the site-packages). I create the
directory & import a class. This is what happens:

Generating to
C:\TEMP\gen_py\2.3\08EF934A-521D-4E29-A92F-0FDE92DDE9D6x0x1x0.py
Failed to execute command:
from win32com.client import makepy;makepy.main()
Traceback (most recent call last):
File
"C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\toolmenu.py",
line 103, in HandleToolCommand
exec "%s\n" % pyCmd
File "<string>", line 1, in ?
File "C:\Python23\Lib\site-packages\win32com\client\makepy.py", line
362, in main
GenerateFromTypeLibSpec(arg, f, verboseLevel = verboseLevel,
bForDemand = bForDemand, bBuildHidden = hiddenSpec)
File "C:\Python23\Lib\site-packages\win32com\client\makepy.py", line
273, in GenerateFromTypeLibSpec
gencache.AddModuleToCache(info.clsid, info.lcid, info.major,
info.minor)
File "C:\Python23\Lib\site-packages\win32com\client\gencache.py",
line 514, in AddModuleToCache
mod = _GetModule(fname)
File "C:\Python23\Lib\site-packages\win32com\client\gencache.py",
line 590, in _GetModule
mod = __import__(mod_name)
File
"C:\TEMP\gen_py\2.3\08EF934A-521D-4E29-A92F-0FDE92DDE9D6x0x1x0.py",
line 12, in ?
from win32com.client import Dispatch
ImportError: cannot import name Dispatch
---------------------------------------------------

Now when I try this:

import win32com.client
instance = win32com.client.Dispatch("...")

it tells me that Dispatch is not found ???? I restart pythonwin &
python2.3.2 & win32all "out of the box" before and didn't have any of
these problems. So, is "COM makepy" broken in AP232?
Jul 18 '05 #1
3 2592
Gerson Kurz wrote:
I have problems getting "COM makepy" working in ActivePython 2.3.2.
This is what happens when I start "COM makepy" from the Pythonwin
Menu:

PythonWin 2.3.2 (#49, Nov 6 2003, 10:18:20) [MSC v.1200 32 bit
(Intel)] on win32.
Portions Copyright 1994-2001 Mark Hammond (mh******@skippinet.com.au)
- see 'Help/About PythonWin' for further copyright information.
Failed to execute command:


from win32com.client import makepy;makepy.main()
Traceback (most recent call last):
File
"C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\toolmenu.py",
line 103, in HandleToolCommand
exec "%s\n" % pyCmd
File "<string>", line 1, in ?
File "C:\Python23\Lib\site-packages\win32com\client\__init__.py",
line 12, in ?
import dynamic, gencache, pythoncom
File "C:\Python23\Lib\site-packages\win32com\client\gencache.py",
line 623, in ?
__init__()
File "C:\Python23\Lib\site-packages\win32com\client\gencache.py",
line 52, in __init__
Rebuild()
File "C:\Python23\Lib\site-packages\win32com\client\gencache.py",
line 610, in Rebuild
_SaveDicts()
File "C:\Python23\Lib\site-packages\win32com\client\gencache.py",
line 57, in _SaveDicts
raise RuntimeError, "Trying to write to a readonly gencache
('%s')!" \
RuntimeError: Trying to write to a readonly gencache
('C:\TEMP\gen_py\2.3')!
---------------------------------------------------

OK, so I figure it wants to write to C:\TEMP\gen_py (why? IIRC this
used to be buried somewhere along the site-packages). I create the
directory & import a class. This is what happens:

Generating to
C:\TEMP\gen_py\2.3\08EF934A-521D-4E29-A92F-0FDE92DDE9D6x0x1x0.py
Failed to execute command:
from win32com.client import makepy;makepy.main()
Traceback (most recent call last):
File
"C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\toolmenu.py",
line 103, in HandleToolCommand
exec "%s\n" % pyCmd
File "<string>", line 1, in ?
File "C:\Python23\Lib\site-packages\win32com\client\makepy.py", line
362, in main
GenerateFromTypeLibSpec(arg, f, verboseLevel = verboseLevel,
bForDemand = bForDemand, bBuildHidden = hiddenSpec)
File "C:\Python23\Lib\site-packages\win32com\client\makepy.py", line
273, in GenerateFromTypeLibSpec
gencache.AddModuleToCache(info.clsid, info.lcid, info.major,
info.minor)
File "C:\Python23\Lib\site-packages\win32com\client\gencache.py",
line 514, in AddModuleToCache
mod = _GetModule(fname)
File "C:\Python23\Lib\site-packages\win32com\client\gencache.py",
line 590, in _GetModule
mod = __import__(mod_name)
File
"C:\TEMP\gen_py\2.3\08EF934A-521D-4E29-A92F-0FDE92DDE9D6x0x1x0.py",
line 12, in ?
from win32com.client import Dispatch
ImportError: cannot import name Dispatch
---------------------------------------------------

Now when I try this:

import win32com.client
instance = win32com.client.Dispatch("...")

it tells me that Dispatch is not found ???? I restart pythonwin &
python2.3.2 & win32all "out of the box" before and didn't have any of
these problems. So, is "COM makepy" broken in AP232?


Try creating a "gen_py" directory under the installed win32com
directory. The directory need only exist, not contain anything. This
should make it start working. I'm not sure if the recent APy update
fixed that...

Mark.

Jul 18 '05 #2
On Sat, 22 Nov 2003 11:28:13 +1100, Mark Hammond
<mh******@skippinet.com.au> wrote:
Try creating a "gen_py" directory under the installed win32com
directory. The directory need only exist, not contain anything. This
should make it start working. I'm not sure if the recent APy update
fixed that...


You are right, this fixes both problems. So maybe the installer does
not correctly create the directory? Anyway, many thanks!

Jul 18 '05 #3
[Gerson Kurz wrote]
On Sat, 22 Nov 2003 11:28:13 +1100, Mark Hammond
<mh******@skippinet.com.au> wrote:
Try creating a "gen_py" directory under the installed win32com
directory. The directory need only exist, not contain anything. This
should make it start working. I'm not sure if the recent APy update
fixed that...


You are right, this fixes both problems. So maybe the installer does
not correctly create the directory? Anyway, many thanks!


Yes, ActivePython 2.3.2 build 231 for Windows had this bug. A new build
was recently released (build 232) that fixed this issue.

Trent

--
Trent Mick
Tr****@ActiveState.com

Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: bk | last post by:
hi, i'm using pythonwin 2.2.3 my programm reads and write the outlook-adress book using COM. for this i have to use the makepy utility. after i...
1
by: Justin Stockton | last post by:
I recently upgraded from ActivePython 2.2.2 to ActivePython 2.3.2 and I'm running into an issue importing the win32com.client module. Before...
1
by: Alv Mart | last post by:
Hi, I ran makepy for ADO. After I installed a new version of python I have this error: Do you know why could I have this error? >>> from...
0
by: Jim Kerr | last post by:
Does makepy always respect versioning of interfaces? It appears as though makepy correctly handles versioning of objects you obtain directly, but...
2
by: nvhengr | last post by:
Has anyone seen this? When I run the COM Makepy utility and choose Microsoft Excel 9.0 Object Library (1.3), I get an application error message: ...
2
by: Alexander Eisenhuth | last post by:
Hello together, My system: ActivePython 2.4.1 Windows XP I write a COM Server in VC++ 6.0 using ATL. So far so good. While I develop I got...
1
by: Steve M | last post by:
When I use the COM Makepy utility on one computer with WindowsXP, ActivePython 2.3 and I select the library Microsoft Word 10.0 Object Library...
4
by: suzhi18 | last post by:
Hallo, I've a problem getting makepy running. When I start the tool on my machine with doubleclick everything is fine. But when I try this in my...
14
by: Trent Mick | last post by:
I'm happy to announce that ActivePython 2.6.0.0 is now available for download from: http://www.activestate.com/Products/activepython/ ...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.