由于cmake错误,无法安装python包

2024-10-03 09:15:06 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图通过在终端中执行pip install disptools来安装disptools包。 disptools包链接到这里https://github.com/m-pilia/disptools。 在安装过程中,它会给我一条很长的错误消息,主要错误如下所示

Building wheel for disptools (setup.py) ... error
ERROR: Command errored out with exit status 1:

...

CMake Error:

Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)`

错误中还包括以下内容:

File "/Users/name/anaconda3/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/6p/16591qb93vs76dysmldcz8140000gn/T/pip-install-vn5twf6v/disptools', '-DDISPTOOLS_DEBUG=OFF', '-DDISPTOOLS_OPT=OFF', '-DDISPTOOLS_VERBOSE=ON', '-DDISPTOOLS_LOW_ORDER_PD=OFF', '-DDISPTOOLS_DOUBLE=OFF', '-DDISPTOOLS_CUDA_SUPPORT=OFF', '-DDISPTOOLS_CUDA_ERROR_CHECK=ON', '-DDISPTOOLS_CUDA_ERROR_CHECK_SYNC=ON', '-DDISPTOOLS_PYTHON_SUPPORT=ON', '-DDISPTOOLS_PYTHON_C_MODULE_NAME=_disptools', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=/private/var/folders/6p/16591qb93vs76dysmldcz8140000gn/T/pip-install-vn5twf6v/disptools/build/lib.macosx-10.9-x86_64-3.6', '-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=build/temp.macosx-10.9-x86_64-3.6', '-DPYTHON_EXECUTABLE=/Users/name/anaconda3/bin/python3']' 
returned non-zero exit status 1.

我在网上到处都找过,但我真的找不到任何有用的资源来解决这个问题。 如果有人能帮忙,我会非常感激的


Tags: installpippyonstatus错误exiterror
2条回答

如果您使用的是Python提示(推荐)

conda安装-c conda forge dlib

使用命令python -m pip install disptools可以尝试下载、编译和安装disptools

编译步骤失败,出现一个CMake错误,表明它找不到库OpenMP。您可以在Ubuntu/Debian发行版上使用

sudo apt install libomp-dev

在此之后,您可以再次启动pip命令

我希望你能满足所有的编译要求

相关问题 更多 >