Closed songqing closed 1 year ago
same error
1 bash script/create_dev_conda_env.sh -g 11.7 2 conda activate *** 3 bash script/build_dgl.sh -g -e '-DCMAKE_BUILD_TYPE=DEBUG' 4 python setup.py build_ext --inplace
[1/1] Cythonizing dgl/_ffi/_cython/core.pyx
Error compiling Cython file: ... """ cdef DLManagedTensor* dltensor if self.c_is_view != 0: raise ValueError("to_dlpack do not work with memory views") CALL(DGLArrayToDLPack(self.chandle, &dltensor, alignment)) return pycapsule.PyCapsule_New(dltensor, _c_str_dltensor, _c_dlpack_deleter) ^
dgl/_ffi/_cython/./ndarray.pxi:80:66: Cannot assign type 'void (object) except *' to 'PyCapsule_Destructor'
Traceback (most recent call last):
File "setup.py", line 240, in
OS (e.g., Linux): Ubuntu 20.04 DGL Version : master Backend Library & Version:PyTorch 1.13.0+gpu; Cython 3.0.0 How you installed DGL: source Build command you used: bash script/build_dgl.sh -g -e '-DCMAKE_BUILD_TYPE=DEBUG' Python version: 3.8.17
Should be fixed by https://github.com/dmlc/dgl/pull/6052.
🐛 Bug
When installing DGL, I encountered a problem, it failed. It seems that the Cython has a break change in version 3.0.0, see issue, When I changed Cython to 0.29.21, the problem disappears.
To Reproduce
Steps to reproduce the behavior:
python3 setup.py install
in the python directoryExpected behavior
` [1/1] Cythonizing dgl/_ffi/_cython/core.pyx
Error compiling Cython file: ... """ cdef DLManagedTensor* dltensor if self.c_is_view != 0: raise ValueError("to_dlpack do not work with memory views") CALL(DGLArrayToDLPack(self.chandle, &dltensor, alignment)) return pycapsule.PyCapsule_New(dltensor, _c_str_dltensor, _c_dlpack_deleter) ^
dgl/_ffi/_cython/./ndarray.pxi:80:66: Cannot assign type 'void (object) except ' to 'PyCapsule_Destructor' Traceback (most recent call last): File "setup.py", line 240, in
ext_modules=config_cython(),
File "setup.py", line 141, in config_cython
return cythonize(
File "/opt/conda/envs/pytorch-ci/lib/python3.8/site-packages/Cython/Build/Dependencies.py", line 1134, in cythonize
cythonize_one( args)
File "/opt/conda/envs/pytorch-ci/lib/python3.8/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: dgl/_ffi/_cython/core.pyx
`
Environment
conda
,pip
, source): source