【发布时间】:2021-07-20 07:35:41
【问题描述】:
我未能在 Colab 中安装 scikit-learn-intelex(版本 2021.2.2)。这是我在 Colab 中所做的:
! python -m pip install --upgrade pip
! python -m pip install scikit-learn-intelex
结果,我得到了以下输出,这对我来说看起来很正常。
Collecting pip
Downloading https://files.pythonhosted.org/packages/ac/cf/0cc542fc93de2f3b9b53cb979c7d1118cffb93204afb46299a9f858e113f/pip-21.1-py3-none-any.whl (1.5MB)
|████████████████████████████████| 1.6MB 11.3MB/s
Installing collected packages: pip
Found existing installation: pip 19.3.1
Uninstalling pip-19.3.1:
Successfully uninstalled pip-19.3.1
Successfully installed pip-21.1
和
Collecting scikit-learn-intelex
Downloading scikit_learn_intelex-2021.2.2-py37-none-manylinux1_x86_64.whl (24 kB)
Collecting daal4py==2021.2.2
Downloading daal4py-2021.2.2-py37-none-manylinux1_x86_64.whl (13.6 MB)
|████████████████████████████████| 13.6 MB 108 kB/s
Collecting dpcpp-cpp-rt==2021.*
Downloading dpcpp_cpp_rt-2021.2.0-py2.py3-none-manylinux1_x86_64.whl (171.6 MB)
|████████████████████████████████| 171.6 MB 80 kB/s
Requirement already satisfied: numpy>=1.15 in /usr/local/lib/python3.7/dist-packages (from daal4py==2021.2.2->scikit-learn-intelex) (1.19.5)
Collecting daal==2021.2.2
Downloading daal-2021.2.2-py2.py3-none-manylinux1_x86_64.whl (295.7 MB)
|████████████████████████████████| 295.7 MB 13 kB/s
Collecting tbb==2021.*
Downloading tbb-2021.2.0-py2.py3-none-manylinux1_x86_64.whl (3.9 MB)
|████████████████████████████████| 3.9 MB 64.4 MB/s
Collecting opencl-rt==2021.*
Downloading opencl_rt-2021.2.0-py2.py3-none-manylinux1_x86_64.whl (169.0 MB)
|████████████████████████████████| 169.0 MB 34 kB/s
Requirement already satisfied: intel-openmp==2021.* in /usr/local/lib/python3.7/dist-packages (from dpcpp-cpp-rt==2021.*->daal4py==2021.2.2->scikit-learn-intelex) (2021.2.0)
Collecting common-cmplr-lib-rt==2021.*
Downloading common_cmplr_lib_rt-2021.2.0-py2.py3-none-manylinux1_x86_64.whl (31.6 MB)
|████████████████████████████████| 31.6 MB 162 kB/s
Collecting common-cmplr-lic-rt==2021.*
Downloading common_cmplr_lic_rt-2021.2.0-py2.py3-none-manylinux1_x86_64.whl (24 kB)
Installing collected packages: tbb, common-cmplr-lic-rt, opencl-rt, common-cmplr-lib-rt, dpcpp-cpp-rt, daal, daal4py, scikit-learn-intelex
然后我通过单击 Colab 窗口横幅的 Runtime 中的 Restart runtime 重新启动内核,然后运行以下代码:
from sklearnex import patch_sklearn
运行代码后出现错误消息。它说:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-45b0f2aba6d7> in <module>()
----> 1 from sklearnex import patch_sklearn
ModuleNotFoundError: No module named 'sklearnex'
---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------
谁能告诉我如何在 Colab 中安装该软件包?
【问题讨论】:
-
在
Installing collected packages: tbb, common-cmplr-lic-rt ...之后,您是否收到了这些软件包的successfully installed ...消息,就像您之前为pip所做的那样? -
@AlexK 是的,我收到了和你一样的信息,“
Successfully installed common-cmplr-lib-rt-2021.2.0 common-cmplr-lic-rt-2021.2.0 daal-2021.2.2 daal4py-2021.2.2 dpcpp-cpp-rt-2021.2.0 opencl-rt-2021.2.0 scikit-learn-intelex-2021.2.2 tbb-2021.2.0。” -
我试过了,但在尝试导入时遇到了同样的错误。安装似乎工作。当您在 Colab 中运行
!pip show scikit-learn-intelex时,您可以看到pip将其放置在与numpy相同的位置。也许在这个包的 Github 上打开一个问题。 -
@AlexK 在包的 Github 上提出问题。
标签: python python-3.x scikit-learn pip