Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 使用Cython/VS构建工具构建Python包时出错_Python 3.x_Visual Studio_Visual Studio 2017_Cython_Conda - Fatal编程技术网

Python 3.x 使用Cython/VS构建工具构建Python包时出错

Python 3.x 使用Cython/VS构建工具构建Python包时出错,python-3.x,visual-studio,visual-studio-2017,cython,conda,Python 3.x,Visual Studio,Visual Studio 2017,Cython,Conda,我试图通过在正确的子文件夹中调用python\u Cython\u build.py build\u ext--inplace',在Conda中使用Cython扩展来构建HelixMC包。我安装了Visual Studio Build Tools 2017(3)15.9.11版和Visual Studio Community 2017(2)`15.9.11版。我已经在下面发布了_cython_build.py的代码,以及我使用git版本2.20.0.windows.1发布的错误 和2)使用Vis

我试图通过在正确的子文件夹中调用
python\u Cython\u build.py build\u ext--inplace',在Conda中使用Cython扩展来构建HelixMC包。我安装了
Visual Studio Build Tools 2017(3)
15.9.11版和
Visual Studio Community 2017(2)`15.9.11版。我已经在下面发布了_cython_build.py的代码,以及我使用git版本2.20.0.windows.1发布的错误 和2)使用Visual Studio命令提示符

我真的不知道。我使用的是Windows10系统。我可以只使用包的
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\u cython\u build.py build\u 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
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
使用
python\u cython\u build.py build\u ext--inplace在VS命令提示符下响应

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
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