如何使用 PyPy 和 scikit-learn-intelex 运行 JupyterLab?

How to run JupyterLab with PyPy and scikit-learn-intelex?

提问人:ab0rt 提问时间:8/31/2023 最后编辑:ab0rt 更新时间:9/16/2023 访问量:86

问:

我正在使用 Miniconda 并按照文档创建了一个环境:

conda create -c conda-forge -n pypy-env pypy python=3.9
conda activate pypy-env
conda config --set channel_priority strict

安装我需要的软件包后,安装 scikit-learn-intelex 返回:

(pypy-env) C:\Users\user>conda install --name pypy-env -c conda-forge scikit-learn-intelex
Channels:
 - conda-forge
 - defaults
Platform: win-64
Collecting package metadata (repodata.json): done
Solving environment: | warning  libmamba Problem type not implemented SOLVER_RULE_STRICT_REPO_PRIORITY
done

## Package Plan ##

  environment location: C:\Users\user\AppData\Local\miniconda3\envs\pypy-env

  added / updated specs:
    - scikit-learn-intelex


The following NEW packages will be INSTALLED:

  daal4py            conda-forge/win-64::daal4py-2023.2.1-py39h6d95a06_0
  pyqt               conda-forge/win-64::pyqt-5.15.9-py39hb77abff_4
  pyqt5-sip          conda-forge/win-64::pyqt5-sip-12.12.2-py39h99910a6_4
  scikit-learn       conda-forge/win-64::scikit-learn-1.3.0-py39hfa9d973_0
  scikit-learn-inte~ conda-forge/win-64::scikit-learn-intelex-2023.2.1-py39hcbf5309_0

The following packages will be REMOVED:

  pypy-7.3.12-0_pypy39
  pypy3.9-7.3.12-h994e1e7_3

The following packages will be UPDATED:

  jupyter_client                                 5.3.3-py_0 --> 8.3.1-pyhd8ed1ab_0
  jupyter_core       conda-forge/noarch::jupyter_core-4.5.~ --> conda-forge/win-64::jupyter_core-5.3.1-py39hcbf5309_0
  pandas                               2.0.3-py39haf6a60e_1 --> 2.1.0-py39h32e6231_0
  python                                   3.9.17-0_73_pypy --> 3.9.18-h4de0772_0_cpython

The following packages will be DOWNGRADED:

  argon2-cffi-bindi~                  21.2.0-py39h7a188e9_3 --> 21.2.0-py39ha55989b_3
  brotli-python                        1.0.9-py39h3665ca7_9 --> 1.0.9-py39h99910a6_9
  cffi                                1.15.1-py39h68485e5_3 --> 1.15.1-py39h68f70e3_3
  contourpy                            1.1.0-py39h314d263_0 --> 1.1.0-py39h1f6ef14_0
  debugpy                              1.6.8-py39h3665ca7_0 --> 1.6.8-py39h99910a6_0
  fonttools                           4.42.1-py39h7a188e9_0 --> 4.42.1-py39ha55989b_0
  imagecodecs                      2023.8.12-py39h8ff80d2_0 --> 2023.8.12-py39had998c7_0
  kiwisolver                           1.4.5-py39h314d263_0 --> 1.4.5-py39h1f6ef14_0
  markupsafe                           2.1.3-py39h7a188e9_0 --> 2.1.3-py39ha55989b_0
  matplotlib                           3.7.2-py39h0d475fb_0 --> 3.7.2-py39hcbf5309_0
  matplotlib-base                      3.7.2-py39h2392a8f_0 --> 3.7.2-py39ha3e071c_0
  numpy                               1.25.2-py39h821adfb_0 --> 1.25.2-py39h816b6a6_0
  pillow                              10.0.0-py39hf8900f3_0 --> 10.0.0-py39ha9166d5_0
  psutil                               5.9.5-py39h7a188e9_0 --> 5.9.5-py39ha55989b_0
  python_abi                              3.9-3_pypy39_pp73 --> 3.9-3_cp39
  pywavelets                           1.4.1-py39h8942a9a_0 --> 1.4.1-py39hc266a54_0
  pywin32                                304-py39h0d475fb_2 --> 304-py39h99910a6_2
  pywinpty                            2.0.11-py39h3665ca7_0 --> 2.0.11-py39h99910a6_0
  pyyaml                               6.0.1-py39h7a188e9_0 --> 6.0.1-py39ha55989b_0
  pyzmq                               25.1.1-py39hc8fc7ba_0 --> 25.1.1-py39hea35a22_0
  rpds-py                             0.10.0-py39h3fc3a88_0 --> 0.10.0-py39hf21820d_0
  scikit-image                        0.21.0-py39h3665ca7_0 --> 0.21.0-py39h99910a6_0
  scipy                               1.11.2-py39hbf2a3dc_0 --> 1.11.2-py39hde5eda1_0
  sip                                 6.7.11-py39h3665ca7_0 --> 6.7.11-py39h99910a6_0
  tornado                              6.3.3-py39h7a188e9_0 --> 6.3.3-py39ha55989b_0
  unicodedata2                        15.0.0-py39h7a188e9_0 --> 15.0.0-py39ha55989b_0


Proceed ([y]/n)? y

如果我继续并尝试重新安装 PyPy,这将返回:

(pypy-env) C:\Users\user>conda install --name pypy-env -c conda-forge pypy
Channels:
 - conda-forge
 - defaults
Platform: win-64
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\user\AppData\Local\miniconda3\envs\pypy-env

  added / updated specs:
    - pypy


The following NEW packages will be INSTALLED:

  pypy               conda-forge/noarch::pypy-7.3.12-0_pypy39
  pypy3.9            conda-forge/win-64::pypy3.9-7.3.12-h994e1e7_3

The following packages will be REMOVED:

  daal4py-2023.2.1-py39h6d95a06_0
  pyqt-5.15.9-py39hb77abff_4
  pyqt5-sip-12.12.2-py39h99910a6_4
  scikit-learn-1.3.0-py39hfa9d973_0
  scikit-learn-intelex-2023.2.1-py39hcbf5309_0

The following packages will be SUPERSEDED by a higher-priority channel:

  jupyter_core       conda-forge/win-64::jupyter_core-5.3.~ --> conda-forge/noarch::jupyter_core-4.5.0-py_0

The following packages will be DOWNGRADED:

  argon2-cffi-bindi~                  21.2.0-py39ha55989b_3 --> 21.2.0-py39h7a188e9_3
  brotli-python                        1.0.9-py39h99910a6_9 --> 1.0.9-py39h3665ca7_9
  cffi                                1.15.1-py39h68f70e3_3 --> 1.15.1-py39h68485e5_3
  contourpy                            1.1.0-py39h1f6ef14_0 --> 1.1.0-py39h314d263_0
  debugpy                              1.6.8-py39h99910a6_0 --> 1.6.8-py39h3665ca7_0
  fonttools                           4.42.1-py39ha55989b_0 --> 4.42.1-py39h7a188e9_0
  imagecodecs                      2023.8.12-py39had998c7_0 --> 2023.8.12-py39h8ff80d2_0
  jupyter_client                         8.3.1-pyhd8ed1ab_0 --> 5.3.3-py_0
  kiwisolver                           1.4.5-py39h1f6ef14_0 --> 1.4.5-py39h314d263_0
  markupsafe                           2.1.3-py39ha55989b_0 --> 2.1.3-py39h7a188e9_0
  matplotlib                           3.7.2-py39hcbf5309_0 --> 3.7.2-py39h0d475fb_0
  matplotlib-base                      3.7.2-py39ha3e071c_0 --> 3.7.2-py39h2392a8f_0
  numpy                               1.25.2-py39h816b6a6_0 --> 1.25.2-py39h821adfb_0
  pandas                               2.1.0-py39h32e6231_0 --> 2.0.3-py39haf6a60e_1
  pillow                              10.0.0-py39ha9166d5_0 --> 10.0.0-py39hf8900f3_0
  psutil                               5.9.5-py39ha55989b_0 --> 5.9.5-py39h7a188e9_0
  python                          3.9.18-h4de0772_0_cpython --> 3.9.17-0_73_pypy
  python_abi                                     3.9-3_cp39 --> 3.9-3_pypy39_pp73
  pywavelets                           1.4.1-py39hc266a54_0 --> 1.4.1-py39h8942a9a_0
  pywin32                                304-py39h99910a6_2 --> 304-py39h0d475fb_2
  pywinpty                            2.0.11-py39h99910a6_0 --> 2.0.11-py39h3665ca7_0
  pyyaml                               6.0.1-py39ha55989b_0 --> 6.0.1-py39h7a188e9_0
  pyzmq                               25.1.1-py39hea35a22_0 --> 25.1.1-py39hc8fc7ba_0
  rpds-py                             0.10.0-py39hf21820d_0 --> 0.10.0-py39h3fc3a88_0
  scikit-image                        0.21.0-py39h99910a6_0 --> 0.21.0-py39h3665ca7_0
  scipy                               1.11.2-py39hde5eda1_0 --> 1.11.2-py39hbf2a3dc_0
  sip                                 6.7.11-py39h99910a6_0 --> 6.7.11-py39h3665ca7_0
  tornado                              6.3.3-py39ha55989b_0 --> 6.3.3-py39h7a188e9_0
  unicodedata2                        15.0.0-py39ha55989b_0 --> 15.0.0-py39h7a188e9_0


Proceed ([y]/n)?

尝试安装标准 scikit-learn 的结果相同。我该如何解决这个问题?

编辑:我可以通过运行以下命令来解决此问题:

conda create -c conda-forge -n pypy-env pypy
conda activate pypy-env
conda config --set channel_priority strict
conda install -c conda-forge scikit-learn-intelex
蟒蛇 python-3.x scikit-learn conda pypy

评论


答:

1赞 mattip 8/31/2023 #1

scikit-learn 在 conda for PyPy 上不可用。如果你想使用它,你必须从源代码构建。

评论

0赞 ab0rt 8/31/2023
谢谢你的回答!原则上,scikit-learn 支持 PyPy。这就是为什么我认为从 conda-forge 安装 scikit-learn-intelex 就足够了。如果我理解正确,我应该从 PyPy 环境中遵循本指南吗?
0赞 ab0rt 9/7/2023
正如我在编辑中指出的那样,我可以解决这个问题。但是,如果我没记错的话,你的答案是错误的。此外,在这种情况下,您的回答不同。您可能没有看到我从一开始就从 conda-forge 安装。