从 setup.py 安装 pandas 时遇到一些与 cython 相关的错误。无法修复该错误。我正在尝试使用 setup.py 离线安装库
[16/40] Cythonizing pandas\_libs/reduction.pyx
Error compiling Cython file:
------------------------------------------------------------
...
self.orig_data = self.buf.data
self.orig_len = self.buf.shape[0]
self.orig_stride = self.buf.strides[0]
self.buf.data = self.values.data
pandas\_libs\reduction.pyx:472:15: Assignment to a read-only property
Traceback (most recent call last):
File "setup.py", line 791, in <module>
setup_package()
File "setup.py", line 761, in setup_package
ext_modules=maybe_cythonize(extensions, compiler_directives=directives),
File "setup.py", line 540, in maybe_cythonize
return cythonize(extensions, *args, **kwargs)
File "D:\Pickle Examples\examples_aix\example_aix\lib\site-packages\Cython\Build\Dependencies.py", line 1110, in cythonize
cythonize_one(*args)
File "D:\Pickle Examples\examples_aix\example_aix\lib\site-packages\Cython\Build\Dependencies.py", line 1277, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: pandas\_libs/reduction.pyx
根据对这个问题的评论,为我解决的问题是降级 Cython。
pip install Cython==0.29.37