python - 无法在 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
推荐阅读
- android - 仅将视图拖动到左侧或右侧。
- symfony - Symfony 为不同的环境(产品、测试、开发)使用不同的学说夹具
- google-analytics - 在 Analytics 上对 AMP 和非 AMP 页面进行分组
- c# - 缩放时保持笔 DashStyle 的恒定空间
- python - 组合计算不正确
- angular - 将数据从父组件传递到子组件
- angular - Angular - 调度动作时出现“TypeError:无法冻结”
- pdf - 更新:如何定位到 PDF 文件中的确切位置?
- vue.js - 如何在 Vue.js 模板中使用全局变量?
- go - 在go中,为什么打印时反射的值和它的接口都一样?