Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling Cython file #52

Open
guotong1988 opened this issue Dec 31, 2016 · 5 comments
Open

Error compiling Cython file #52

guotong1988 opened this issue Dec 31, 2016 · 5 comments

Comments

@guotong1988
Copy link

guotong1988 commented Dec 31, 2016

python setup.py build_ext --inplace
running build_ext
cythoning utils/bbox.pyx to utils/bbox.c

Error compiling Cython file:
------------------------------------------------------------
...
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Sergey Karayev
# --------------------------------------------------------

cimport cython
       ^
------------------------------------------------------------

utils/bbox.pyx:8:8: Compiler crash in AnalyseDeclarationsTransform

File 'ModuleNode.py', line 103, in analyse_declarations: ModuleNode(bbox.pyx:1:0,
    full_module_name = 'utils.cython_bbox')
File 'Nodes.py', line 425, in analyse_declarations: StatListNode(bbox.pyx:8:0)
File 'Nodes.py', line 425, in analyse_declarations: StatListNode(bbox.pyx:8:8)
File 'Nodes.py', line 7346, in analyse_declarations: CImportStatNode(bbox.pyx:8:8,
    module_name = u'cython')

Compiler crash traceback from this point on:
  File "/home/gt/anaconda2/lib/python2.7/site-packages/Cython/Compiler/Nodes.py", line 7346, in analyse_declarations
    self.module_name, self.pos, relative_level=0 if self.is_absolute else -1)
  File "/home/gt/anaconda2/lib/python2.7/site-packages/Cython/Compiler/Symtab.py", line 1159, in find_module
    module_name, relative_to=relative_to, pos=pos, absolute_fallback=absolute_fallback)
  File "/home/gt/anaconda2/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 178, in find_module
    pxd_pathname = self.find_pxd_file(qualified_name, pos)
  File "/home/gt/anaconda2/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 239, in find_pxd_file
    pxd = self.search_include_directories(qualified_name, ".pxd", pos, sys_path=sys_path)
  File "/home/gt/anaconda2/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 280, in search_include_directories
    tuple(self.include_directories), qualified_name, suffix, pos, include, sys_path)
  File "/home/gt/anaconda2/lib/python2.7/site-packages/Cython/Utils.py", line 29, in wrapper
    res = cache[args] = f(*args)
  File "/home/gt/anaconda2/lib/python2.7/site-packages/Cython/Utils.py", line 119, in search_include_directories
    path = os.path.join(dir, dotted_filename)
  File "/home/gt/anaconda2/lib/python2.7/posixpath.py", line 73, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 9: ordinal not in range(128)
building 'utils.cython_bbox' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/utils
{'gcc': ['-Wno-cpp', '-Wno-unused-function']}
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/gt/anaconda2/lib/python2.7/site-packages/numpy/core/include -I/home/gt/anaconda2/include/python2.7 -c utils/bbox.c -o build/temp.linux-x86_64-2.7/utils/bbox.o -Wno-cpp -Wno-unused-function
utils/bbox.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
 #error Do not use this file, it is the result of a failed Cython compilation.
  ^
error: command 'gcc' failed with exit status 1
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1
@chaituNova
Copy link

May be you can use anaconda, it creates a virtual environment. Also it has huge number of repos. you can install just by doing "conda install cython" after installing the anaconda.

@aqzas
Copy link

aqzas commented Jan 28, 2017

well, I encounter the same problem and I have used anaconda

@baristahell
Copy link

I encounter the same issue, has someone found how to deal with it?
I commented out the GPU-related lines and now i get this. (I'm using caffe and the original repo but it's the same thing)

@LinkToPast1990
Copy link

I using ubuntu16.04,anaconda python2.7 and I face the same problem……how to fix this?

wadefelix pushed a commit to wadefelix/Faster-RCNN_TF that referenced this issue Feb 24, 2018
wadefelix pushed a commit to wadefelix/Faster-RCNN_TF that referenced this issue Feb 24, 2018
@maqy1995
Copy link

maqy1995 commented Mar 1, 2018

I encounter the same issue,and the reason is the path to Faster-RCNN_TF include chinese.
After I move the file to /home/username/,the issue not appear anymore.
By the way,i use the tensorflow-gpu 1.4.1 ,and I encounter the an issue about nsync_cv.h ,the web fixes my problem. #245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants