[Pythonmac-SIG] Building stuff - another silly newbie
question!
Chris Scott
kaffeen@mac.com
Mon, 05 Nov 2001 10:43:26 -0500
Hi Jack -
Thanks for trying to help, I appreciate it. It's kind of funny, I've found a
whole bunch of tutorials on how to write Python. But not a single one on how
to use it... All this building, installing modules stuff is really quite
foreign to me. Anyway, here goes -
I'm running Python 2.2b1 on a G4 Mac, OS9. I've got Python configured for
Classic since I'm trying to learn Tkinter as well.
I downloaded this file - http://www.pygame.org/ftp/pygame-1.1-src.sit and
let it unstuff automatically.
I run setup_mac.py and it pulls that dialog box and I add the verbose and
build commands (since they're the defaults and I'm not sure what else to do)
and this is what I get:
No Arguments Given, Perform Default Install? [Y/n]y
running build
running build_py
creating build
creating :build:lib.mac-2.2
creating :build:lib.mac-2.2:pygame
copying :lib:__init__.py -> :build:lib.mac-2.2:pygame
copying :lib:cursors.py -> :build:lib.mac-2.2:pygame
copying :lib:locals.py -> :build:lib.mac-2.2:pygame
copying :lib:UserRect.py -> :build:lib.mac-2.2:pygame
copying :lib:version.py -> :build:lib.mac-2.2:pygame
running build_ext
building 'pygame.imageext' extension
Create export file 244 HD:Applications:Python
2.2b1:pygame-1.1.1:build:temp.mac-2.2:imageext.mcp.exp
Create XML file 244 HD:Applications:Python
2.2b1:pygame-1.1.1:build:temp.mac-2.2:imageext.xml
Create project file 244 HD:Applications:Python
2.2b1:pygame-1.1.1:build:temp.mac-2.2:imageext.mcp
Traceback (most recent call last):
File "244 HD:Applications:Python 2.2b1:pygame-1.1.1:setup_mac.py", line
146, in ?
apply(setup, [], PACKAGEDATA)
File "244 HD:Applications:Python 2.2b1:Lib:distutils:core.py", line 138,
in setup
dist.run_commands()
File "244 HD:Applications:Python 2.2b1:Lib:distutils:dist.py", line 896,
in run_commands
self.run_command(cmd)
File "244 HD:Applications:Python 2.2b1:Lib:distutils:dist.py", line 916,
in run_command
cmd_obj.run()
File "244 HD:Applications:Python 2.2b1:Lib:distutils:command:build.py",
line 106, in run
self.run_command(cmd_name)
File "244 HD:Applications:Python 2.2b1:Lib:distutils:cmd.py", line 330, in
run_command
self.distribution.run_command(command)
File "244 HD:Applications:Python 2.2b1:Lib:distutils:dist.py", line 916,
in run_command
cmd_obj.run()
File "244 HD:Applications:Python
2.2b1:Lib:distutils:command:build_ext.py", line 256, in run
self.build_extensions()
File "244 HD:Applications:Python
2.2b1:Lib:distutils:command:build_ext.py", line 383, in build_extensions
self.build_extension(ext)
File "244 HD:Applications:Python
2.2b1:Lib:distutils:command:build_ext.py", line 475, in build_extension
build_temp=self.build_temp)
File "244 HD:Applications:Python 2.2b1:Lib:distutils:ccompiler.py", line
663, in link_shared_object
extra_preargs, extra_postargs, build_temp)
File "244 HD:Applications:Python 2.2b1:Lib:distutils:mwerkscompiler.py",
line 195, in link
mkcwproject.makeproject(xmlfilename, projectfilename)
File "244 HD:Applications:Python 2.2b1:Mac:Lib:mkcwproject:__init__.py",
line 71, in makeproject
cw.my_mkproject(prjfss, xmlfss)
File "244 HD:Applications:Python 2.2b1:Mac:Lib:mkcwproject:cwtalker.py",
line 36, in my_mkproject
self.make(new=project_document, with_data=xmlfile, as=prjfile)
File "244 HD:Applications:Python
2.2b1:Mac:Lib:lib-scriptpackages:CodeWarrior:Standard_Suite.py", line 124,
in make
raise aetools.Error, aetools.decodeerror(_arguments)
aetools.Error: (-1708, 'the AppleEvent was not handled by any handler',
None)
Once that's done I have a "build" folder that contains two other folders:
lib.mac-2.2 and temp.mac-2.2. The lib folder contains a pygame folder with 5
pygame modules (there should be around 20) and the temp folder contains
three files: imageext.mcp.exp, imageext.xml, and mwerks_imageext_config.h.
I copy the pygame folder and it's five modules into my Python folder and add
that folder to the Python prefs file.
When I try to import pygame into Python, I get this:
>>> from pygame import *
Traceback (most recent call last):
File "<input>", line 1, in ?
File "244 HD:Applications:Python 2.2b1:pygame:__init__.py", line 27, in ?
from pygame.base import *
ImportError: No module named base
And there I am. It seems like I run into trouble with every module I try to
build. I mentioned before having trouble with pyopengl too. Any help is much
appreciated, and any pointers to where I can go to learn how to actually
work this stuff would be appreciated as well. Thanks!
- Chris
on 11/5/01 5:05 AM, Jack Jansen at jack@oratrix.nl wrote:
>> I'm sure this is a silly question - but how do you build modules? I've been
>> trying like phooey to build the modules that come with pygame in a
>> non-carbon format, but I can't seem to do it. Likewise, I've been unable to
>> get PyOpenGL to build (version 1.5.7) without errors.
>
> Are you trying to build extensions under MacPython or under OSX commandline
> Python?
>
> For the latter everything should work by simply running setup.py (assuming the
> extension module has one).
>
> For the former that should also work, but distutils support in MacPython is
> not as good as in Unix Python. I would definitely like to hear about problems
> with it. What would work best is a report of what you're trying to install
> (URL where I can download the distribution, please, so I can try for myself)
> and how the build failed.
>
> There's about a 80% chance that the problem is in the setup.py that comes with
> the module, though: often people hard-code Unix pathnames (which also happen
> to sort-of work on Windows) and such. In that case you'll be morally obliged
> to send my feedback on to the module authors:-)
> --
> Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++
> Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
> www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm
>
>