无法在 Spyder 中安装模块 IDE
Unable to install a module in Spyder IDE
我有以下问题。我正在使用 Spyder IDE(但没有 Anaconda)。我想安装 statsmodels.api
。查看我的步骤(我将它们写在 IPython 控制台中):
1)
import statsmodels.api as sm
Traceback (most recent call last):
File "<ipython-input-1-085740203b77>", line 1, in <module>
import statsmodels.api as sm
ModuleNotFoundError: No module named 'statsmodels'
pip install statsmodels
Note: you may need to restart the kernel to use updated packages.
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
然后我使用 ctrl
+ .
重新启动内核
3)
IPython 7.22.0 -- An enhanced Interactive Python.
Restarting kernel...
但是要知道,当我再次尝试步骤 1) 时,我没有看到任何进展。换句话说,模块没有安装。
4)
import statsmodels.api as sm
Traceback (most recent call last):
File "<ipython-input-2-085740203b77>", line 1, in <module>
import statsmodels.api as sm
ModuleNotFoundError: No module named 'statsmodels'
请问问题出在哪里?
在 IPython 控制台中使用 !pip
而不是 pip
。
我有以下问题。我正在使用 Spyder IDE(但没有 Anaconda)。我想安装 statsmodels.api
。查看我的步骤(我将它们写在 IPython 控制台中):
1)
import statsmodels.api as sm
Traceback (most recent call last):
File "<ipython-input-1-085740203b77>", line 1, in <module>
import statsmodels.api as sm
ModuleNotFoundError: No module named 'statsmodels'
pip install statsmodels
Note: you may need to restart the kernel to use updated packages.
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
然后我使用 ctrl
+ .
重新启动内核
3)
IPython 7.22.0 -- An enhanced Interactive Python.
Restarting kernel...
但是要知道,当我再次尝试步骤 1) 时,我没有看到任何进展。换句话说,模块没有安装。
4)
import statsmodels.api as sm
Traceback (most recent call last):
File "<ipython-input-2-085740203b77>", line 1, in <module>
import statsmodels.api as sm
ModuleNotFoundError: No module named 'statsmodels'
请问问题出在哪里?
在 IPython 控制台中使用 !pip
而不是 pip
。