首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装pysph时C++编译器可能出现的问题

安装pysph时C++编译器可能出现的问题
EN

Stack Overflow用户
提问于 2022-10-13 18:54:22
回答 1查看 53关注 0票数 0

我在试着安装pysph。我尝试了MSVC 2017和MSVC 2022。当我尝试执行pip install时,最后会出现以下错误。

代码语言:javascript
复制
 building 'pysph.base.octree' extension
  "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD "-IC:\Users\Matthew Scholar\AppData\Local\Temp\pip-build-env-8kmg9l2e\overlay\Lib\site-packages\numpy\core\include" "-Ic:\users\matthew scholar\appdata\local\programs\python\python38\include" "-Ic:\users\matthew scholar\appdata\local\programs\python\python38\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" /EHsc /Tppysph/base/octree.cpp /Fobuild\temp.win-amd64-cpython-38\Release\pysph/base/octree.obj /openmp
  octree.cpp

  c:\users\matthew scholar\appdata\local\temp\pip-build-env-8kmg9l2e\overlay\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION


  pysph/base/octree.cpp(9616): error C3861: '_Pragma': identifier not found

  pysph/base/octree.cpp(9616): error C2059: syntax error: ';'

  pysph/base/octree.cpp(9634): error C3861: '_Pragma': identifier not found

  pysph/base/octree.cpp(9634): error C2059: syntax error: ';'

  pysph/base/octree.cpp(9769): error C3861: '_Pragma': identifier not found

  pysph/base/octree.cpp(9769): error C2059: syntax error: ';'

  pysph/base/octree.cpp(9787): error C3861: '_Pragma': identifier not found

  pysph/base/octree.cpp(9787): error C2059: syntax error: ';'

  pysph/base/octree.cpp(9927): error C2065: '__pyx_parallel_exc_type': undeclared identifier

  pysph/base/octree.cpp(9929): error C2065: '__pyx_parallel_exc_type': undeclared identifier

  pysph/base/octree.cpp(9930): error C2065: '__pyx_parallel_exc_type': undeclared identifier

  pysph/base/octree.cpp(9930): error C2065: '__pyx_parallel_exc_value': undeclared identifier

  pysph/base/octree.cpp(9930): error C2065: '__pyx_parallel_exc_tb': undeclared identifier

  pysph/base/octree.cpp(9931): error C2065: '__pyx_parallel_filename': undeclared identifier

  pysph/base/octree.cpp(15447): error C3010: '__pyx_L12_error': jump out of OpenMP structured block not allowed
  
  C:\Users\Matthew Scholar\AppData\Local\Temp\pip-build-env-8kmg9l2e\overlay\Lib\site-packages\setuptools\command\build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'pysph.base' as data is deprecated, please list it in `packages`.

    check.warn(importable)

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

  ----------------------------------------
  ERROR: Failed building wheel for pysph

编辑:通过使用MSVC 2019和python 3.8修复(安装了早期版本的vtk用于mayavi)

EN

回答 1

Stack Overflow用户

发布于 2022-10-14 15:42:55

我从未使用过PySPH,但以下是一些我想排除的东西:

  1. 确保您使用的是正确的命令,应该是

代码语言:javascript
复制
pip install PySPH

这是取自https://pypi.org/project/PySPH/

尝试从https://github.com/pypr/pysph安装

代码语言:javascript
复制
git clone https://bitbucket.org/pysph/pysph.git

请确保文档中有相关的依赖项,有一个专门用于安装https://pysph.readthedocs.io/en/1.0a1/installation.html#installing-the-dependencies-on-windows的 C++编译器部分。

您可以通过命令提示符检查是否安装了依赖项。

代码语言:javascript
复制
<name of dependency> --version

  1. 一个可能的问题可能是测试失败https://github.com/pypr/pysph/actions/workflows/tests.yml,最近似乎已经修复了windows上的测试失败。我建议从最新版本的

安装git克隆。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74060506

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档