Re: Installing Pyrex on MacBook with Mac OS X Leopard

Greg Ewing <[email protected]>
Newsgroups gmane.comp.python.pyrex
Message-ID <[email protected]>
Raymond Sammut wrote:

> $ python pyrexc myfile.pyx
> 
> /System/Library/Frameworks/Python.framework/Versions/2.5/Resources/ 
> Python.app/Contents/MacOS/Python: can't open file 'pyrexc': [Errno 2]  
> No such file or directory

That's not the way you use pyrexc -- it's a shell
command, not a Python module.

There are two currently supported ways of invoking
pyrex:

1) Write a setup.py that imports and uses the distutils
    extension.

2) Write a Makefile that uses the pyrexc command, gcc,
    etc. to do it all the old-fashioned way.

You could also use pyrexc from the shell or a Makefile
to generate the .c files, and then use a normal setup.py
to compile and link them.

The Demos directory contains some example setup.py files
for you to look at.

It's also possible to import the Pyrex compiler from a
Python script and call it directly, but the details
aren't documented yet.

-- 
Greg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.