记录一下使用天池实验室GPU安装库过程中遇到的问题:
首先想使用sklearn:
from sklearn.metrics import f1_score
但是提示:‘No module named 'sklearn’
新建cell输入:
pip install sklearn
输出报错:
The following command must be run outside of the IPython shell:
$ pip install sklearn
The Python package manager (pip) can only be used from outside of IPython.
Please reissue the `pip` command in a separate terminal or command prompt.
See the Python documentation for more information on how to install packages:
https://docs.python.org/3/installing/
也就是说天池GPU用的是IPython shell,不能在cell里安装库,所以新建一个Terminal:

首先pip install sklearn,又报错:

本文详细记录了在天池实验室的GPU环境中安装Python库sklearn所遇到的问题及解决过程。首先遇到'No module named 'sklearn''的错误,然后在IPython shell中尝试安装,但因numpy、pandas和scipy版本过低导致报错。通过升级pip并以管理员方式安装,逐步解决了numpy、scipy的版本问题。接着安装并升级了graphviz和pandas,最后安装了seaborn,使得notebook可以正常运行,成功规避了所有报错。
1397

被折叠的 条评论
为什么被折叠?



