Question to python C API

Andreas Otto aotto1968 at onlinehome.de
Fri Apr 17 02:22:01 EDT 2009


Hi,

  just my first step in Cython

  1. download Cython-0.11.1

  2. read INSTALL.txt

>>>>>>>>>>>><
(1) Run the setup.py script in this directory
    as follows:

        python setup.py install

    This will install the Pyrex package
    into your Python system.
<<<<<<<<<<<<<

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

  3. this happen

>>>>>>>>>>>>>
>python ./setup.py install
Traceback (most recent call last):
  File "./setup.py", line 5, in <module>
    from Cython.Compiler.Version import version
  File "/home/dev1usr/src/Cython-0.11.1/Cython/__init__.py", line 2, in
<module>
    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 setup.py
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

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

> python setup.py build_ext --inplace   
Traceback (most recent call last):
  File "setup.py", 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 ?


mfg

  Andreas Otto



More information about the Python-list mailing list