Question to python C API

Andreas Otto aotto1968 at
Fri Apr 17 08:22:01 CEST 2009


  just my first step in Cython

  1. download Cython-0.11.1

  2. read INSTALL.txt

(1) Run the script in this directory
    as follows:

        python install

    This will install the Pyrex package
    into your Python system.

        Question 1: Why you wall it "Pyrex" package ?

  3. this happen

>python ./ install
Traceback (most recent call last):
  File "./", line 5, in <module>
    from Cython.Compiler.Version import version
  File "/home/dev1usr/src/Cython-0.11.1/Cython/", line 2, in
    from Shadow import *
ImportError: No module named Shadow

  4. I use a thread enabled python V3 

        Question 2: What I have to do ?

  4. than I try the second part from INSTALL.txt

(2) If you prefer not to modify your Python
    installation, arrange for the directory
    containing this file (INSTALL.txt) to be in
    your PYTHONPATH. On unix, also put the bin
    directory on your PATH.

  5. and start to build the hello world example

        I changed:      print "Hello World"
        to:             print("Hello World")    -> this is V3
  6. but got the following error

> cat
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

    cmdclass = {'build_ext': build_ext},
    ext_modules = [Extension("pymsgque", ["helloworld.pyx"])]

> python build_ext --inplace   
Traceback (most recent call last):
  File "", line 3, in <module>
    from Cython.Distutils import build_ext
ImportError: No module named Cython.Distutils

  7. a little bit to much errors for the first step, isn't it ?


  Andreas Otto

More information about the Python-list mailing list