我对数据科学和python很陌生。我正在尝试使用scikitplot绘制在Spyder(Python 3.6)中建立的模型的累积增益曲线。但是,它不断返回错误:ModuleNotFoundError:没有名为“ scikitplot”的模块。
请参见下文:
import scikitplot as skplt
Traceback (most recent call last):
File "<ipython-input-17-1b8f6cd7465e>", line 1, in <module>
import scikitplot as skplt
ModuleNotFoundError: No module named 'scikitplot'
我尝试在anaconda提示符下使用以下内容:
pip install -U scikit-learn scipy matplotlib
和
pip3 install -U scikit-learn scipy matplotlib
但是,这些都不起作用。 anaconda提示中的结果:
(base) C:\Users\johndoe>pip install -U scikit-learn scipy matplotlib
Collecting scikit-learn
Downloadinghttps://files.pythonhosted.org/packages/8f/1c/9c1d550068f015685d0fccb1726ace7163bbfe5b1a16bda1dcd28d99cb65/scikit_learn-0.20.0-cp36-cp36m-win_amd64.whl (4.7MB)
100% |████████████████████████████████| 4.8MB 2.7MB/s
Requirement already up-to-date: scipy in c:\programdata\anaconda3\lib\site-
packages (1.1.0)
Collecting matplotlib
Downloadinghttps://files.pythonhosted.org/packages/b1/56/569c83515c10146fd0aa09e086816b12e301d0811048e3354a6e9b77ba9a/matplotlib-3.0.2-cp36-cp36m-win_amd64.whl (8.9MB)
100% |████████████████████████████████| 8.9MB 3.0MB/s
Requirement not upgraded as not directly required: numpy>=1.8.2 in
c:\programdata\anaconda3\lib\site-packages (from scikit-learn) (1.14.3)
Requirement not upgraded as not directly required:
pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in
c:\programdata\anaconda3\lib\site-packages (from matplotlib) (2.2.0)
Requirement not upgraded as not directly required: python-dateutil>=2.1 in
c:\programdata\anaconda3\lib\site-packages (from matplotlib) (2.7.3)
Requirement not upgraded as not directly required: cycler>=0.10 in
c:\programdata\anaconda3\lib\site-packages (from matplotlib) (0.10.0)
Requirement not upgraded as not directly required: kiwisolver>=1.0.1 in
c:\programdata\anaconda3\lib\site-packages (from matplotlib) (1.0.1)
Requirement not upgraded as not directly required: six>=1.5 in
c:\programdata\anaconda3\lib\site-packages (from python-dateutil>=2.1-
>matplotlib) (1.11.0)
Requirement not upgraded as not directly required: setuptools in
c:\programdata\anaconda3\lib\site-packages (from kiwisolver>=1.0.1-
>matplotlib)
(39.1.0)
distributed 1.21.8 requires msgpack, which is not installed.
Installing collected packages: scikit-learn, matplotlib
Found existing installation: scikit-learn 0.19.1
Uninstalling scikit-learn-0.19.1:
Could not install packages due to an EnvironmentError: [WinError 5] Access
is denied: 'c:\\programdata\\anaconda3\\lib\\site-packages\\scikit_learn-
0.19.1-py3.6.egg-info\\dependency_links.txt'
Consider using the `--user` option or check the permissions.
感谢任何可能知道我在做错事情的人。
答案 0 :(得分:0)
您是否安装了Matplotlib。 Scikit-plot取决于Scikit-learn和Matplotlib
答案 1 :(得分:0)
使用此命令:
pip install --trusted-host=pypi.org --trusted-host=files.pythonhosted.org --user Scikit-plot