Buildout with build part with Cython

I ran into a cython problem in buildout.

One part is building the module using cython from file .cand file .pyx.

I have already tried many solutions:

But it all ends with an error:

ImportError: No module named Cython.Distutils

This is an addition when buildout loads setup.pythis cython module.

Note that it setup.pyis functional when called from its own directory and with an interpreter in the bin bin directory.

Thank you for your help.

+5
source share
3 answers

, Cython , site-packages. :

  • root Cython python -. .

  • Python. , Python, . , Python .

  • virtualenv. ( buildout) Python, site-packages. Python ( Python, ).

virtualenv .

+4

https://pypi.python.org/pypi/mr.cython/1.0 .

, cython , build setup.py develop

cython cython .

+2

, .

:

python bootstrap.py
./bin/buildout install cython
./bin/cpy bootstrap.py
./bin/cpy ./bin/buildout

, , , buildout "install", , , :

[buildout]
parts = deps py   # <---- Notice we don't depend on cython here
eggs =
  whatever
  kdist
  nark
  kivy # <--- But we do have a module that requires cython to build
develop =
  .
  lib/nark
  lib/kivy-dist

[cython] # <---- By calling ./bin/buildout install cython we trigger this
recipe = zc.recipe.egg:script
parts = cython-py
interpreter = cpy # <--- Which makes our dummy ./bin/cpy 
eggs =
  cython
  pyinstaller

[deps]
recipe = zc.recipe.egg:eggs
eggs = ${buildout:eggs}

[py]
recipe = zc.recipe.egg:script
interpreter = py
eggs = ${buildout:eggs}

, bin, bin, :

$ ls bin/
buildout garden   py

, , . buildout?

... , , cython , juts .

+1

All Articles