setup.py syntax error building python-imaging

Sherwin J. Singer singer at chemistry.ohio-state.edu
Sun May 11 06:41:08 EDT 2003


Fredrik and David:

Thanks very much for your very quick responses.  Of course, David is totally 
correct and invoking python2 gets the ball rolling.  Then I hit another 
problem: 

distutils.errors.DistutilsPlatformError: invalid Python installation: unable 
to open /usr/lib/python2.2/config/Makefile (No such file or directory)

Indeed there is no config directory in either /usr/lib/python2.2 or 
/usr/lib/python1.5.

Please let me know if there is a convenient fix.  Otherwise I'll wait until 
I upgrade from RH7.3.  (My goal is to install Sketch.  Hey, xfig is still 
OK for now.)

Thanks for your help,
   Sherwin

=============  FULL TRACEBACK ===================================
running build_ext
Traceback (most recent call last):
  File "setup.py", line 301, in ?
    ext_modules = MODULES,
  File "//usr/lib/python2.2/distutils/core.py", line 138, in setup
    dist.run_commands()
  File "//usr/lib/python2.2/distutils/dist.py", line 893, in run_commands
    self.run_command(cmd)
  File "//usr/lib/python2.2/distutils/dist.py", line 913, in run_command
    cmd_obj.run()
  File "//usr/lib/python2.2/distutils/command/build.py", line 107, in run
    self.run_command(cmd_name)
  File "//usr/lib/python2.2/distutils/cmd.py", line 330, in run_command
    self.distribution.run_command(command)
  File "//usr/lib/python2.2/distutils/dist.py", line 913, in run_command
    cmd_obj.run()
  File "//usr/lib/python2.2/distutils/command/build_ext.py", line 231, in 
run
    customize_compiler(self.compiler)
  File "//usr/lib/python2.2/distutils/sysconfig.py", line 139, in 
customize_compiler
    (cc, opt, ccshared, ldshared, so_ext) = \
  File "//usr/lib/python2.2/distutils/sysconfig.py", line 421, in 
get_config_vars
    func()
  File "//usr/lib/python2.2/distutils/sysconfig.py", line 326, in 
_init_posix
    raise DistutilsPlatformError(my_msg)
distutils.errors.DistutilsPlatformError: invalid Python installation: unable 
to open /usr/lib/python2.2/config/Makefile (No such file or directory)

=================================================================

> Sherwin J. Singer wrote:
> 
>> I am trying to build python-imaging on RH7.3 (so I can use Sketch). 
>> After successfully compiling libImaging.a, I get a syntax error trying to
>> execute the setup.py program:
>>
>> > python setup.py build
>>   File "setup.py", line 191
>>     for fw in 'Tcl', 'Tk'
>>       ^
>> SyntaxError: invalid syntax
> 
> there's a list comprehension in the mac os x build fork that
> wasn't supposed to be there.
> 
> workarounds:
> 
> - make sure you're building with Python 2.1 or later (see
>   David's reply)
> 
> - edit setup.py, and replace the code inside the
>   <if sys.platform == "darwin"> clause with a single
>   "pass"
> 
> - downgrade to PIL 1.1.3
> 
> - change "Python 2.0" to "Python 2.1" in PIL's README file
> 
> I'll fix this in 1.1.5.
> 
> thanks /F

-- 

Sherwin Singer
Department of Chemistry
Ohio State University
100 W. 18th Ave.
Columbus, OH 43210
614-292-8909
614-292-1685 (fax)




More information about the Python-list mailing list