【发布时间】:2015-10-24 21:33:15
【问题描述】:
我正在尝试从 Cython 教程构建 Hello World example。 我已经编写了 hello.pyx 和 setup.py 文件:
# hello.pyx
def say_hello_to(name):
print("Hello %s!" % name)
# setup.py
try:
from setuptools import setup
from setuptools import Extension
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
setup(
name='Hello world app',
ext_modules=cythonize("hello.pyx"),
)
当我跑步时
python setup.py build_ext --inplace
我收到以下错误:
copying build\lib.win-amd64-2.7\cython_test\hello.pyd -> cython_test
error: [Errno 2] No such file or directory: 'cython_test\\hello.pyd'
构建过程运行良好,我得到了一个有效的 hello.pyd 文件,但由于某种原因 setup.py 无法将 .pyd 复制回工作目录。我该如何解决?
hello.pyx 和 setup.py 文件也可在 BitBucket
获得【问题讨论】: