【发布时间】:2020-10-29 09:41:16
【问题描述】:
我想在 Google Colab 上使用一个包 (resreg)。我将它安装在我的第一个单元中
!pip install resreg
我得到以下输出:
Collecting resreg
Downloading https://files.pythonhosted.org/packages/61/74/0b664a8507e15507da5031fd92877d57551a7d362edc8089aa369c340e84/resreg-0.1-py3-none-any.whl
Collecting scikit-learn==0.21.0
Downloading https://files.pythonhosted.org/packages/b7/6c/ec121123c671d980c6969dfc69d0f09e1d7f88d80d373f511e61d773b85c/scikit_learn-0.21.0-cp36-cp36m-manylinux1_x86_64.whl (6.6MB)
|████████████████████████████████| 6.6MB 3.8MB/s
Requirement already satisfied: scipy>=1.0.0 in /usr/local/lib/python3.6/dist-packages (from resreg) (1.4.1)
Requirement already satisfied: pandas>=0.24.0 in /usr/local/lib/python3.6/dist-packages (from resreg) (1.0.5)
Requirement already satisfied: numpy>=1.14.0 in /usr/local/lib/python3.6/dist-packages (from resreg) (1.18.5)
Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.6/dist-packages (from scikit-learn==0.21.0->resreg) (0.15.1)
Requirement already satisfied: python-dateutil>=2.6.1 in /usr/local/lib/python3.6/dist-packages (from pandas>=0.24.0->resreg) (2.8.1)
Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.6/dist-packages (from pandas>=0.24.0->resreg) (2018.9)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.6/dist-packages (from python-dateutil>=2.6.1->pandas>=0.24.0->resreg) (1.12.0)
Installing collected packages: scikit-learn, resreg
Found existing installation: scikit-learn 0.22.2.post1
Uninstalling scikit-learn-0.22.2.post1:
Successfully uninstalled scikit-learn-0.22.2.post1
Successfully installed resreg-0.1 scikit-learn-0.21.0
然后我重新启动运行时使用
">Runtime >Restart Runtime"
当我尝试导入包时,出现以下错误
from sklearn.linear_models import ElasticNet
import resreg
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-be63596e9fde> in <module>()
1 from sklearn.linear_model import ElasticNet
---> 2 import resreg
ModuleNotFoundError: No module named 'resreg'
可能出了什么问题?
【问题讨论】:
标签: python import scikit-learn pip google-colaboratory