gpt4 book ai didi

python - UserWarning : Starting from version 2. 2.1,macOS 发行轮中的库文件由 Apple Clang (Xcode_8.3.3) 编译器构建

转载 作者:行者123 更新时间:2023-12-03 20:50:19 25 4
gpt4 key购买 nike

我在我的 Windows 机器中使用 lightgbm 算法和 fastapi 构建了一个预测应用程序,当时我的应用程序完全 100% 运行。直到,我更改为 mac 机器并尝试再次运行该应用程序并收到此消息:

/Users/bhaskoromuthohar/dev/cm/credit-scoring/.venv/lib/python3.7/site-packages/lightgbm/__init__.py:48: UserWarning: Starting from version 2.2.1, the library file in distribution wheels for macOS is built by the Apple Clang (Xcode_8.3.3) compiler.
This means that in case of installing LightGBM from PyPI via the ``pip install lightgbm`` command, you don't need to install the gcc compiler anymore.
Instead of that, you need to install the OpenMP library, which is required for running LightGBM on the system with the Apple Clang compiler.
You can install the OpenMP library by the following command: ``brew install libomp``.
"You can install the OpenMP library by the following command: ``brew install libomp``.", UserWarning)
我尝试使用 brew 安装 libomp 并执行 pip install lightgbm 但仍然无法完美运行我的应用程序。
enter image description here
P.s:我是mac环境的新手

最佳答案

请参见:
https://github.com/microsoft/LightGBM/issues/1933
https://github.com/microsoft/LightGBM/issues/1898
特别是:
https://github.com/microsoft/LightGBM/issues/1898#issuecomment-455024936
正如贡献者在这些线程中提到的那样,警告并不一定意味着您没有安装 lightgbm,但表明他们最近更改了用于构建轮子的编译器。
例如您遇到的错误很可能不是由此引起的。如果您更详细地描述您遇到的错误以及无效的错误,我将更新我的答案。
然而,由于目前的答案是制定出来的,它使您相信您对收到的警告感到吃惊,并且您将其视为错误( 我很可能是错误的,这就是为什么欢迎提供更多详细信息的原因 )
如果您无法运行您的代码并且实际上有与 lightgbm 相关的错误,您可以尝试以下操作:

pip install wheel

pip install libomp

brew link libomp
如果未搜索/usr/local,您可能需要确保可以发现 lib 和 include 目录:
-L/usr/local/opt/libomp/lib -I/usr/local/opt/libomp/include

关于python - UserWarning : Starting from version 2. 2.1,macOS 发行轮中的库文件由 Apple Clang (Xcode_8.3.3) 编译器构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63201587/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com