question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Building from source: undeclared name not builtin: PY_VERSION_HEX

See original GitHub issue

Hi. I am packaging Spacy for NixOS and issued an error (see below). Does it look familiar? What should I do to fix it?

Thanks!

Error compiling Cython file:
------------------------------------------------------------

cdef dict __Pyx_globals = globals()
if PY_VERSION_HEX >= 0x03040000:
                 ^
------------------------------------------------------------

EnumType:51:18: undeclared name not builtin: PY_VERSION_HEX
Traceback (most recent call last):
  File "/nix/store/iz9xmfqca3g1hn3pd7r0wqsfhwy3ali5-python2.7-Cython-0.24.1/bin/.cython-wrapped", line 12, in <module>
    sys.exit(setuptools_main())
  File "/nix/store/iz9xmfqca3g1hn3pd7r0wqsfhwy3ali5-python2.7-Cython-0.24.1/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 698, in setuptools_main
    return main(command_line = 1)
  File "/nix/store/iz9xmfqca3g1hn3pd7r0wqsfhwy3ali5-python2.7-Cython-0.24.1/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 715, in main
    result = compile(sources, options)
  File "/nix/store/iz9xmfqca3g1hn3pd7r0wqsfhwy3ali5-python2.7-Cython-0.24.1/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 690, in compile
    return compile_multiple(source, options)
  File "/nix/store/iz9xmfqca3g1hn3pd7r0wqsfhwy3ali5-python2.7-Cython-0.24.1/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 668, in compile_multiple
    result = run_pipeline(source, options, context=context)
  File "/nix/store/iz9xmfqca3g1hn3pd7r0wqsfhwy3ali5-python2.7-Cython-0.24.1/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 495, in run_pipeline
    err, enddata = Pipeline.run_pipeline(pipeline, source)
  File "/nix/store/iz9xmfqca3g1hn3pd7r0wqsfhwy3ali5-python2.7-Cython-0.24.1/lib/python2.7/site-packages/Cython/Compiler/Pipeline.py", line 365, in run_pipeline
    data = phase(data)
  File "/nix/store/iz9xmfqca3g1hn3pd7r0wqsfhwy3ali5-python2.7-Cython-0.24.1/lib/python2.7/site-packages/Cython/Compiler/Pipeline.py", line 130, in inject_utility_code_stage
    tree = utilcode.get_tree(cython_scope=context.cython_scope)
  File "/nix/store/iz9xmfqca3g1hn3pd7r0wqsfhwy3ali5-python2.7-Cython-0.24.1/lib/python2.7/site-packages/Cython/Compiler/UtilityCode.py", line 167, in get_tree
    assert not err, err

Your Environment

  • Operating System: NixOS
  • Python Version Used: 2.7
  • spaCy Version Used: 1.2.0
  • Environment Information:

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pquentincommented, Nov 21, 2016

PY_VERSION_HEX is defined in patchlevel.h, which is included from Python.h. See https://hg.python.org/cpython/file/tip/Include/patchlevel.h. Probably not spaCy’s fault?

0reactions
lock[bot]commented, May 8, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cython error: Undeclared name not built in:array
I think it is not recognizing numpy array but it is strange cause I have imported numpy already. cython(''' cimport numpy as np...
Read more >
undeclared name not built in errors - Google Groups
This particular error seems to crop up when trying to import certain python modules within cython. Moreover the behavior varies from platform to...
Read more >
Cython: undeclared name not builtin - Ask Sagemath
Loading a .spyx file with def bla(W): RootSystem(W.cartan_type()) yields undeclared name not builtin: RootSystem Is there a library that I ...
Read more >
numpy - Cython error: Undeclared name not built in:aray -
i compiling cython code in sage cell server , following error. undeclared name not builtin: array. it displays same error in sage notebook....
Read more >
fused type: undeclared name not builtin: double
fused type: undeclared name not builtin: double I'm trying to use Fused Types in my cython anycodings_cython codes, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found