1

I have successfully generated .c file using Cython, but when i try to compile it using gcc, i get these errors... This is just the first line of the error... There are 3 pages of errors similar to this... My .py code is a simple:

print "test"

error:

unknown type name ‘Py_UNICODE’
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
6
  • PyPy is a JIT. It does not generate C code. What makes you think PyPy can do this for you? Commented Jan 27, 2014 at 3:21
  • I have been experimenting with cython and pypy, and it seems i have mistaken pypy for cython... Commented Jan 27, 2014 at 3:24
  • OK, edited your question accordingly! Commented Jan 27, 2014 at 3:25
  • 2
    Modifying the question this extensively does no one any favors. If you have a new question, ask a new question. Commented Jan 27, 2014 at 3:31
  • @IgnacioVazquez-Abrams You have alot of SO reputation. Do you think this is a case for a rollback? Commented Jan 27, 2014 at 3:35

1 Answer 1

1

See this mailing list post.

Citing it:

Cython is not a Python to C compiler in the sense that it does away
with the Python interpreter/runtime, rather it creates .c files that
are compiled against the Python/C API and can be loaded into a running
session. 

See this list of interpreters which lists some compilers that might be useful to you!

For a guide to compilation, also have a look at the compilation page of the Cython wiki

Sign up to request clarification or add additional context in comments.

2 Comments

Sure, but why can't it leave the intermediate .c file regardless?
@IgnacioVazquez-Abrams It is indeed possible to compile to C, once you get a .pyx file, see docs.cython.org/src/reference/language_basics.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.