473,395 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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\site-packages\win32com\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\site-packages\win32com\__init__.py

if not __gen_path__:
try:
import win32com.gen_py
__gen_path__ = sys.modules["win32com.gen_py"].__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.GetTempPath(), "gen_py",
"%d.%d" % (sys.version_info[0],
sys.version_info[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 1678

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 have run the utiltity everything is fine and i...
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 ADODB import Connection,Recordset >>> conn =...
1
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...
1
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...
2
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...
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: PythonWin: Pythonwin.exe - Application Error...
0
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...
1
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...
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 Code: makepy.py -i "Microsoft Excel 11.0...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...

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.