Ошибка сборки пакета Python с помощью инструментов сборки Cython / VS - PullRequest
1 голос
/ 02 мая 2019

Я пытаюсь собрать пакет HelixMC здесь , используя расширение Cython в Conda, вызвав python _cython_build.py build_ext --inplace' in the correct subfolder. I have Visual Studio Build Tools 2017 (3) version 15.9.11 and Visual Studio Community 2017 (2) `версия 15.9 .11 установлено. Я разместил код _cython_build.py ниже, а также ошибки, которые я использую, используя 1) git version 2.20.0.windows.1 и 2) с помощью командной строки Visual Studio.

Я буквально понятия не имею. Я использую систему Windows 10. Я мог бы просто собрать с файлом setup.py для пакета, но я хочу попробовать собрать с cython.

_cython_build.py

from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy

ext_modules = [Extension(
    "_util_cython", ["_util_cython.pyx"], include_dirs=[numpy.get_include()])]

setup(
    cmdclass={'build_ext': build_ext},
    ext_modules=ext_modules
)

ответ в git bash с python _cython_build.py build_ext --inplace

running build_ext
building '_util_cython' extension
b'\\\x00W\x00i\x00n\x00d\x00o\x00w\x00s\x00 \x00w\x00a\x00s\x00 \x00u\x00n\x00e\x00x\x00p\x00e\x00c\x00t\x00e\x00d\x00
\x00a\x00t\x00 \x00t\x00h\x00i\x00s\x00 \x00t\x00i\x00m\x00e\x00.\x00\r\x00\n\x00'
error: Error executing cmd /u /c "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcv
arsall.bat" x86_amd64 && set

ответ в командной строке VS с python _cython_build.py build_ext --inplace

running build_ext
skipping '_util_cython.c' Cython extension (up-to-date)
building '_util_cython' extension
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\bjwil\Anaconda3\Lib\site-packages\numpy\core\include -IC:\Users\bjwil\Anaconda3\include -IC:\Users\bjwil\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tc_util_cython.c /Fobuild\temp.win-amd64-3.7\Release\_util_cython.obj
_util_cython.c
c:\users\bjwil\anaconda3\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(12) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
_util_cython.c(2613): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data
_util_cython.c(2642): warning C4244: '=': conversion from '__pyx_t_5numpy_intp_t' to 'long', possible loss of data
_util_cython.c(2676): warning C4244: '=': conversion from '__pyx_t_5numpy_intp_t' to 'long', possible loss of data
_util_cython.c(2689): warning C4244: '=': conversion from '__pyx_t_5numpy_intp_t' to 'long', possible loss of data
_util_cython.c(2691): warning C4244: '=': conversion from '__pyx_t_5numpy_intp_t' to 'long', possible loss of data
_util_cython.c(2704): warning C4244: '=': conversion from '__pyx_t_5numpy_intp_t' to 'long', possible loss of data
_util_cython.c(2715): warning C4244: '=': conversion from '__pyx_t_5numpy_intp_t' to 'long', possible loss of data
_util_cython.c(2728): warning C4244: '=': conversion from '__pyx_t_5numpy_intp_t' to 'long', possible loss of data
_util_cython.c(3372): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data
_util_cython.c(3435): warning C4244: '=': conversion from '__pyx_t_5numpy_intp_t' to 'long', possible loss of data
_util_cython.c(3446): warning C4244: '=': conversion from '__pyx_t_5numpy_intp_t' to 'long', possible loss of data
_util_cython.c(3612): warning C4244: '=': conversion from '__pyx_t_5numpy_intp_t' to 'long', possible loss of data
_util_cython.c(3616): warning C4244: '=': conversion from '__pyx_t_5numpy_intp_t' to 'long', possible loss of data
_util_cython.c(4042): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data
_util_cython.c(4245): warning C4244: '=': conversion from '__pyx_t_5numpy_intp_t' to 'long', possible loss of data
_util_cython.c(4247): warning C4244: '=': conversion from '__pyx_t_5numpy_intp_t' to 'long', possible loss of data
_util_cython.c(4268): warning C4244: '=': conversion from '__pyx_t_5numpy_intp_t' to 'long', possible loss of data
_util_cython.c(4291): warning C4244: '=': conversion from '__pyx_t_5numpy_intp_t' to 'long', possible loss of data
_util_cython.c(4302): warning C4244: '=': conversion from '__pyx_t_5numpy_intp_t' to 'long', possible loss of data
_util_cython.c(4313): warning C4244: '=': conversion from '__pyx_t_5numpy_intp_t' to 'long', possible loss of data
_util_cython.c(4375): warning C4244: '=': conversion from '__pyx_t_5numpy_intp_t' to 'long', possible loss of data
_util_cython.c(20293): error C2039: 'exc_type': is not a member of '_ts'
c:\users\bjwil\anaconda3\include\pystate.h(212): note: see declaration of '_ts'
_util_cython.c(20294): error C2039: 'exc_value': is not a member of '_ts'
c:\users\bjwil\anaconda3\include\pystate.h(212): note: see declaration of '_ts'
_util_cython.c(20295): error C2039: 'exc_traceback': is not a member of '_ts'
c:\users\bjwil\anaconda3\include\pystate.h(212): note: see declaration of '_ts'
_util_cython.c(20307): error C2039: 'exc_type': is not a member of '_ts'
c:\users\bjwil\anaconda3\include\pystate.h(212): note: see declaration of '_ts'
_util_cython.c(20308): error C2039: 'exc_value': is not a member of '_ts'
c:\users\bjwil\anaconda3\include\pystate.h(212): note: see declaration of '_ts'
_util_cython.c(20309): error C2039: 'exc_traceback': is not a member of '_ts'
c:\users\bjwil\anaconda3\include\pystate.h(212): note: see declaration of '_ts'
_util_cython.c(20310): error C2039: 'exc_type': is not a member of '_ts'
c:\users\bjwil\anaconda3\include\pystate.h(212): note: see declaration of '_ts'
_util_cython.c(20311): error C2039: 'exc_value': is not a member of '_ts'
c:\users\bjwil\anaconda3\include\pystate.h(212): note: see declaration of '_ts'
_util_cython.c(20312): error C2039: 'exc_traceback': is not a member of '_ts'
c:\users\bjwil\anaconda3\include\pystate.h(212): note: see declaration of '_ts'
_util_cython.c(20355): error C2039: 'exc_type': is not a member of '_ts'
c:\users\bjwil\anaconda3\include\pystate.h(212): note: see declaration of '_ts'
_util_cython.c(20356): error C2039: 'exc_value': is not a member of '_ts'
c:\users\bjwil\anaconda3\include\pystate.h(212): note: see declaration of '_ts'
_util_cython.c(20357): error C2039: 'exc_traceback': is not a member of '_ts'
c:\users\bjwil\anaconda3\include\pystate.h(212): note: see declaration of '_ts'
_util_cython.c(20358): error C2039: 'exc_type': is not a member of '_ts'
c:\users\bjwil\anaconda3\include\pystate.h(212): note: see declaration of '_ts'
_util_cython.c(20359): error C2039: 'exc_value': is not a member of '_ts'
c:\users\bjwil\anaconda3\include\pystate.h(212): note: see declaration of '_ts'
_util_cython.c(20360): error C2039: 'exc_traceback': is not a member of '_ts'
c:\users\bjwil\anaconda3\include\pystate.h(212): note: see declaration of '_ts'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
...