Problems Compiling Python 2.6.7 for Win7


J

Jay Osako

I have been trying to get PyODBC to work with Python 2.6 (the latest
version it is known to be compatible with) and Django, but have run
into a problem which, according to the information I've got elsewhere,
probably stems from a DLL incompatibility - apparently, the standard
CPython distribution for Windows is compiled with VS2008, and there is
a required runtime library (VSC900.DLL, if I recall correctly) which
will only work if all of the other libraries used are compiled with
the exact same version (including service pack). Since VS2008 is not
readily available anymore, I am compiling PyODBC and Django-Pyodbc
using MinGW, which needless to say does not include a Visual C++
runtime library.

This leaves me with three choices: either find a copy of the exact
version of VC++ 2008 which was used to compile the distro, or compile
Python from sources with MinGW, or re-compile everything using VS2010.
Each of these approaches has had problems.

The first of these problems is, of course, tracking down a copy of VC+
+ 2008 Express. While one would think that this would be the simplest
solution, Microsfot themselves no longer provide the installer for
this, and I'm not sure I'd trust most of the other sources claiming to
provide it.

When trying to compile using VC++ 2010, I get a long series of errors,
most of which are related to headers; the headers in question are
present, but only visible in the parts of the solution which they are
part of, it seems. Trying to untangle this is likely to take more time
than I have available for this project.

When compiling using MinGW and distools, I get a problem where a file
path is coming up as None. I made some minor changes to ntpath.py to
work around places where IMAO it should have detected the missing path
string, but eventually it comes to a point where there is an assertion
that (correctly) fails on an empty path. The traceback is:

Traceback (most recent call last):
File "C:\PYTHON~1.7\setup.py", line 2036, in <module>
main()
File "C:\PYTHON~1.7\setup.py", line 2031, in main
'Lib/smtpd.py']
File "C:\Python26\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python26\lib\distutils\dist.py", line 975, in run_commands
self.run_command(cmd)
File "C:\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "C:\Python26\lib\distutils\command\build.py", line 134, in run
self.run_command(cmd_name)
File "C:\Python26\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "C:\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "C:\Python26\lib\distutils\command\build_ext.py", line 340, in
run
self.build_extensions()
File "C:\PYTHON~1.7\setup.py", line 149, in build_extensions
missing = self.detect_modules()
File "C:\PYTHON~1.7\setup.py", line 1325, in detect_modules
if os.path.isfile(os.path.join(srcdir, 'Modules',
'_elementtree.c')):
File "C:\Python26\lib\ntpath.py", line 96, in join
assert path is not None and len(path) > 0
AssertionError

I cannot seem to determine where the missing path is coming from, or
is supposed to come from, and again, walking back through the
traceback will take more time than I can afford. I mean to try it, but
I most likely will need to set it aside fiarly soon.

if anyone here could give me any information as to what I am doing
wrong, I would be sincerely grateful.
 
Ad

Advertisements

G

Gabriel Genellina

I have been trying to get PyODBC to work with Python 2.6 (the latest
version it is known to be compatible with) and Django, but have run
into a problem which, according to the information I've got elsewhere,
probably stems from a DLL incompatibility - apparently, [...]

The first of these problems is, of course, tracking down a copy of VC+
+ 2008 Express. While one would think that this would be the simplest
solution, Microsfot themselves no longer provide the installer for
this, and I'm not sure I'd trust most of the other sources claiming to
provide it.

Doesn't http://www.microsoft.com/express/Downloads/#2008-Visual-CPP work
for you?
I didn't try past the initial download prompt, but it seems to be the
right version.
 
Ad

Advertisements

J

Jay Osako

I have been trying to get PyODBC to work with Python 2.6 (the latest
version it is known to be compatible with) and Django, but have run
into a problem which, according to the information I've got elsewhere,
probably stems from a DLL incompatibility - apparently, [...]
The first of these problems is, of course, tracking down a copy of VC+
+ 2008 Express. While one would think that this would be the simplest
solution, Microsfot themselves no longer provide the installer for
this, and I'm not sure I'd trust most of the other sources claiming to
provide it.

Doesn'thttp://www.microsoft.com/express/Downloads/#2008-Visual-CPPwork  
for you?
I didn't try past the initial download prompt, but it seems to be the  
right version.

<kicks self> How did I overlook that?

Well, OK, that seems to just what I needed, though I still seem to be
having some trouble with the actual Django project. Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top