【问题标题】:vaex-core windows vendor/pybind11/include\pybind11/numpy.h(35): error C2065: 'ssize_t': undeclared identifiervaex-core windows vendor/pybind11/include\pybind11/numpy.h(35): error C2065: 'ssize_t': undeclared identifier
【发布时间】:2022-06-11 06:15:12
【问题描述】:

我在尝试从源代码构建包时出错。

      "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\Lenovo\AppData\Local\Temp\pip-build-env-6gtrxy7u\overlay\Lib\site-packages\numpy\core\include -Ivendor/pybind11/include -Ivendor/pybind11/include -Ivendor/string-view-lite/include -Ivendor/boost -IC:\Python\Python310\include -IC:\Python\Python310\Library\include -Ivendor\pcre\Library\include -IC:\Python\Python310\include -IC:\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /EHsc /Tpsrc\strings.cpp /Fobuild\temp.win-amd64-3.10\Release\src\strings.obj /EHsc
      strings.cpp
      vendor/pybind11/include\pybind11/numpy.h(35): error C2065: 'ssize_t': undeclared identifier
      vendor/pybind11/include\pybind11/numpy.h(35): error C2338: ssize_t != Py_intptr_t
      C:\Users\Lenovo\AppData\Local\Temp\pip-install-vmdjo61j\vaex-core_8c00779b22c745ba90d323d5396909c4\src\string_utils.hpp(208): warning C4244: '=': conversion from 'char32_t' to 'char', possible loss of data
      vendor\pcre\Library\include\pcrecpp.h(701): warning C4251: 'pcrecpp::RE::pattern_': class 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' needs to have dll-interface to be used by clients of class 'pcrecpp::RE'
      C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\xstring(4905): note: see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>'
      src\strings.cpp(273): warning C4018: '>': signed/unsigned mismatch
      src\strings.cpp(282): warning C4018: '>': signed/unsigned mismatch
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for vaex-core
  Building wheel for future (setup.py) ... done
  Created wheel for future: filename=future-0.18.2-py3-none-any.whl size=491070 sha256=181e9fce6f02e9d9ededfda32bcd4f51fcb0cc556bb9245af0294c279e6bd36e
  Stored in directory: c:\users\lenovo\appdata\local\pip\cache\wheels\22\73\06\557dc4f4ef68179b9d763930d6eec26b88ed7c389b19588a1c
  Building wheel for aplus (setup.py) ... done
  Created wheel for aplus: filename=aplus-0.11.0-py3-none-any.whl size=4410 sha256=70a7aab29eb4cd9eafb025d16acc94ffb3259763f346ec37838f05a65f591d4a
  Stored in directory: c:\users\lenovo\appdata\local\pip\cache\wheels\74\ed\14\4d7bffd9475a07582e0c256b9b1ddbbc1f49c58e3150d356f4
Successfully built future aplus
Failed to build vaex-core
ERROR: Could not build wheels for vaex-core, which is required to install pyproject.toml-based projects

我无法在 windows 上的 python3.10 中安装 vaex-core。

【问题讨论】:

    标签: python


    【解决方案1】:

    The solution 是编辑.../pybind11/include/pybind11/numpy.h 以提供ssize_t 的定义:

    #include statements之后的文件顶部附近找到这些代码行:

    #if defined(_MSC_VER)
    #  pragma warning(push)
    #  pragma warning(disable: 4127) // warning C4127: Conditional expression is constant
    #endif
    

    改为:

    #if defined(_MSC_VER)
    #  pragma warning(push)
    #  pragma warning(disable: 4127) // warning C4127: Conditional expression is constant
    #include <BaseTsd.h>
    typedef SSIZE_T ssize_t;
    #endif
    

    【讨论】:

      猜你喜欢
      • 2018-03-05
      • 1970-01-01
      • 1970-01-01
      • 2019-05-18
      • 1970-01-01
      • 2021-12-22
      • 1970-01-01
      • 2022-01-17
      • 1970-01-01
      相关资源
      最近更新 更多