安装scikit-learn并将PyPy用作Python解释器

new9mtju  于 2023-02-07  发布在  Python
关注(0)|答案(1)|浏览(145)

我尝试创建一个以PyPy作为默认解释器的conda env(实际上我使用的是Mamba),然后安装Scikit-Learn来执行机器学习任务。
mamba create -n sklearn -c conda-forge pypy python
实际上,在env激活后在shell中运行python会返回:

Python 3.9.16 | packaged by conda-forge | (feeb267e, Jan 18 2023, 16:13:01)
[PyPy 7.3.11 with GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>>

然后,我尝试安装scikit-learn包与mamba install -n sklearn -c conda-forge scikit-learn和我得到这个输出:

Looking for: ['scikit-learn']

conda-forge/linux-64                                          No change
conda-forge/noarch                                  11.1MB @   2.3MB/s  5.0s
Could not solve for environment specs
Encountered problems while solving:
  - nothing provides python 3.6.9 1_73_pypy needed by pypy-7.3.1-h9f0ad1d_1

The environment can't be solved, aborting the operation

我用conda和pip install都试过了,但是我得到了其他关于包冲突的错误。我也试过用mamba create -n myenv -c conda-forge scikit-learn制作一个环境,但是这会安装标准的CPython实现作为解释器。
有办法实现这一点,还是我应该摆脱PyPy?

uurv41yg

uurv41yg1#

scikit-learn的conda-forge配方还没有更新到pypy3.9,你可以尝试从源代码构建。

相关问题