scikit problem

文章描述了在使用Python的scikit-learn库时遇到的ImportError,原因可能是scikit-learn未正确构建,且指出在从源代码安装时需确保正确编译。提示用户检查Python版本、操作系统和平台是否匹配安装需求。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.7/site-packages/sklearn/__check_build/__init__.py", line 48, in <module>
    from ._check_build import check_build  # noqa
ImportError: /home/pi/.local/lib/python3.7/site-packages/sklearn/__check_build/../../scikit_learn.libs/libgomp-d22c30c5.so.1.0.0: cannot allocate memory in static TLS block

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/media/pi/9B5A-AE1B/classiPi.py", line 8, in <module>
    from sklearn.preprocessing import StandardScaler
  File "/home/pi/.local/lib/python3.7/site-packages/sklearn/__init__.py", line 81, in <module>
    from . import __check_build  # noqa: F401
  File "/home/pi/.local/lib/python3.7/site-packages/sklearn/__check_build/__init__.py", line 50, in <module>
    raise_build_error(e)
  File "/home/pi/.local/lib/python3.7/site-packages/sklearn/__check_build/__init__.py", line 43, in raise_build_error
    % (e, local_dir, "".join(dir_content).strip(), msg)
ImportError: /home/pi/.local/lib/python3.7/site-packages/sklearn/__check_build/../../scikit_learn.libs/libgomp-d22c30c5.so.1.0.0: cannot allocate memory in static TLS block
___________________________________________________________________________
Contents of /home/pi/.local/lib/python3.7/site-packages/sklearn/__check_build:
__init__.py               __pycache__               _check_build.cpython-37m-aarch64-linux-gnu.so
setup.py
___________________________________________________________________________
It seems that scikit-learn has not been built correctly.

If you have installed scikit-learn from source, please do not forget
to build the package before using it: run `python setup.py install` or
`make` in the source directory.

If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.
>>> 
 

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值