I tried to build and I got this:
azambran@matrix:~/sources/mercurial-1.2.1> python setup.py buildI looked for the string: "invalid Python installation: unable to open" and found the file "/usr/lib/python2.5/distutils/sysconfig.py", I found the string :
running build
running build_py
running build_ext
error: invalid Python installation: unable to open /usr/lib/python2.5/config/Makefile (No such file or directory)
def _init_posix():which lead me here:
"""Initialize the module as appropriate for POSIX systems."""
g = {}
# load the installed Makefile:
try:
filename = get_makefile_filename()
parse_makefile(filename, g)
except IOError, msg:
my_msg = "invalid Python installation: unable to open %s" % filename
if hasattr(msg, "strerror"):
my_msg = my_msg + " (%s)" % msg.strerror
raise DistutilsPlatformError(my_msg)
def get_makefile_filename():I am leaving this blog post and will follow it up with comments in case somebody needs the solution to this problem.
"""Return full pathname of installed Makefile from the Python build."""
if python_build:
return os.path.join(os.path.dirname(sys.executable), "Makefile")
lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
return os.path.join(lib_dir, "config", "Makefile")
The main goal of this post is to show that even if you have no clue about the code that you are using you can still reach the internals of a large code base. Following this approach will help others who might want to help you and help you narrowing down the questions that you ask.
This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
You can set the environment variable DISTUTILS_DEBUG=1 to get a little more information.
ReplyDeleteI think that Makefile is supposed to be installed when you build and install Python. Each of the Python installations on my Mac has one, anyway.
Thanks jto, I had the same discussions earlier on IRC, it makes no sense that the config/Makefile does not exist; Maybe the system administrators removed something?
ReplyDeleteI will use what you tell me and see how it goes.