Anaconda3 Cython:gcc找不到-lpthread,-lc

时间:2018-06-01 08:40:41

标签: python linker pthreads anaconda cython

我在Xubuntu 16.04上使用python3.6.5运行Anaconda3。我想运行简单的Cython示例here,但直接跑到墙上。

$ cat helloworld.pyx 
print("Hello World")

$ cat setup.py 
from distutils.core import setup
from Cython.Build import cythonize

setup(
    ext_modules = cythonize("helloworld.pyx")
)

$ python setup.py build_ext --inplace
Compiling helloworld.pyx because it changed.
[1/1] Cythonizing helloworld.pyx
running build_ext
building 'helloworld' extension
creating build
creating build/temp.linux-x86_64-3.6
gcc -pthread -B /home/j/OFFICIAL/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/j/OFFICIAL/anaconda3/include/python3.6m -c helloworld.c -o build/temp.linux-x86_64-3.6/helloworld.o
gcc -pthread -shared -B /home/j/OFFICIAL/anaconda3/compiler_compat -L/home/j/OFFICIAL/anaconda3/lib -Wl,-rpath=/home/j/OFFICIAL/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/helloworld.o -o /home/j/gits/proj/fitting_multipoles/test/helloworld.cpython-36m-x86_64-linux-gnu.so
/home/j/OFFICIAL/anaconda3/compiler_compat/ld: cannot find -lpthread
/home/j/OFFICIAL/anaconda3/compiler_compat/ld: cannot find -lc
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

尝试使用conda update --all更新所有conda包,没有帮助。 conda install cython没有帮助。我试图从终端的输出消息中运行gcc命令。第一个是好的,只有第二个提出错误。问题是什么?

0 个答案:

没有答案