473,657 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

gen_py target directory for makepy

I had an unusual problem tonight running makepy to install some
Microsoft COM interfaces in a Python 2.5 Windows XP installation
created using the ActiveState installer.

In earlier versions of Python, the files were generated to:

\PythonXX\Lib\s ite-packages\win32c om\gen_py

But in my 2.5 installation they were generated to my temp
directory, in my case this was:

c:\temp\gen_py\ 2.5

I hadn't paid attention to the messages and when I cleared my
temp directory, which I occasionally do, the COM interfaces
stopped working.

Tracing through the makepy code, I found the following
(reformatted for email) in

\Python25\Lib\s ite-packages\win32c om\__init__.py

if not __gen_path__:
try:
import win32com.gen_py
__gen_path__ = sys.modules["win32com.gen_p y"].__path__[0]
except ImportError:
# If a win32com\gen_py directory already exists, then we use it
# (gencache doesn't insist it have an __init__, but our
# __import__ above does!
__gen_path__ = \
os.path.abspath (os.path.join(_ _path__[0], "gen_py"))
if not os.path.isdir(_ _gen_path__):
# We used to dynamically create a directory under win32com -
# but this sucks. If the dir doesn't already exist, we we
# create a version specific directory under the user temp
# directory.
__gen_path__ = os.path.join(
win32api.GetTem pPath(), "gen_py",
"%d.%d" % (sys.version_in fo[0],
sys.version_inf o[1]))

I was able to make everything work right by creating the gen_py
directory in the expected place and re-running makepy. But I'm
curious to know:

1. Why does it suck to create gen_py dynamically?

2. Why didn't I have a gen_py directory already? Did I somehow
destory it or is it not created by default?

3. Why is the temp directory the alternate choice for where to
put these?

Thanks.

Alan
Apr 9 '08 #1
0 1724

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

Similar topics

0
543
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 have run the utiltity everything is fine and i can run my py-file without any errors. but if i close the pythonwin and restart and then try to run my py-script i get the following error: File "C:\Program Files\Python22\contacts_ausgabe.py", line 45, in
1
2112
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 ADODB import Connection,Recordset >>> conn = Connection()
1
1856
by: Cristian Hasbun from Chile | last post by:
I need a win32com guru please... i'm not python expert, but i understand mi trouble... Requirements: Hook EyesWeb 3.2.0 (http://www.eyesweb.org) COM Module with Python 2.0.1 i used win32com libraries and generate an early binding for module (using prog_id)
1
1737
by: Olaf Meding | last post by:
When does the makepy utility generate a .py file and when a directory? And what decided if a directory or a file is generated? What is the difference between a file and a directory (both named after the uuid in the IDL file)? Most of the time the code below generates a file called BF79B6C5-47BE-11D2-BACD-006008060A3A.py. But one time it generated a directory with that same name. This directory contained several .py files.
2
4022
by: Svenn-Ivar Svendsen | last post by:
Hi, I use the makepy tool in pythonwin to generate wrappers for my connection point (event) interfaces in a project. It works fine. The question is; Is it possible, in a python script, to detect if wrappers for COM (event) interfaces the script uses have been created, and in case not somehow call the makepy tool manually before proceeding? How should this be done? Best regards, Svenn-Ivar
2
2174
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: PythonWin: Pythonwin.exe - Application Error The instruction at "0x77fcc87" referenced memory at "0x0307a705". The memory could not be "read". I do not get this error when I choose the Microsoft Office 9.0 Object Library (2.1).
0
1094
by: artem.marchenko | last post by:
Hi I am trying to use makepy to generate wrappers from *.tlb for examples for GoogleDesktopSearch SDK (http://desktop.google.com/downloadsdksubmit). However makepy generates only very short __init__.py and no other files. Unfortunately, I am quite new both to Python and COM and can hardly guess what's wrong :( Please, help.
1
1506
by: Chris Curvey | last post by:
I'm trying to track down a performance issue in my Windows code, and hotshot is telling me that the most time and calls are spent in these methods ncalls tottime percall cumtime percall filename:lineno(function) 75975 63982.779 0.842 124464.419 1.638 c:\python24\lib\site-packages\win32com\client\dynamic.py:285(_make_method_) 71294 47871.424 0.671 50629.224 0.710...
4
3458
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 Code: makepy.py -i "Microsoft Excel 11.0 Object Library(1.5)" I am getting an Syntax Error and command:
0
8402
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8315
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8734
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8508
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8608
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7341
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5633
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2733
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.