Jupyter无法识别已安装的statsModels'包裹
我有一个在Anaconda虚拟环境中运行的Jupyter笔记本电脑,该笔记本将无法识别STATSMODELS软件包。我已经使用了PIP和CONDA,并且在重新启动计算机之间重新安装了整个环境。如您所见,在此链接,PIP和CONDA都表明它已安装。但是,我继续遇到此错误:
---> 43 import statsmodels.api as sm
ModuleNotFoundError: No module named 'statsmodels'
起初我认为这是内核,但这无法解释为什么我安装的其他所有软件包都可以正确识别。
我唯一没有做的就是在另一台计算机上尝试过(我正在运行Windows 10 x64)。我只想知道是否有人可以在这样做之前看到我缺少的东西。
谢谢!
编辑: 我已经尝试了以下命令来安装它:
pip install statsmodels
conda install -c conda-forge statsmodels
conda install statsmodels
我已经尝试单独使用每个命令,请确保卸载上一个安装。我一次尝试使用两个方法,具有相同的方法。我尝试了上述安装的所有置换,并在两者之间重新启动计算机。我不认为问题是它没有安装。我不知道为什么,但是jupyter笔记本只是没有识别此软件包。
我正在从Anaconda命令提示符中运行所有命令,并确保激活我的焦点虚拟环境。我还通过将jupyter实验室直接键入命令提示符并击中输入(我确保激活了我的环境)来运行jupyter实验室。
我将尝试在其他操作系统上运行并更新。
I have a Jupyter notebook running inside an Anaconda virtual environment that won't recognize the statsmodels package. I've used both pip and conda, and I've reinstalled the whole environment several times in between restarting my computer. As you can see in this link, both pip and conda show that it is installed. However, I continue to get this error:
---> 43 import statsmodels.api as sm
ModuleNotFoundError: No module named 'statsmodels'
At first I thought it was the kernel, but that wouldn't explain why every other package I've installed is recognized properly.
The only thing I haven't done is tried it on another computer (I'm running Windows 10 x64). I just want to know if anyone can see something that I'm missing before I do so.
Thanks!
Edit:
I've tried the following commands to install it:
pip install statsmodels
conda install -c conda-forge statsmodels
conda install statsmodels
I've tried using each command individually, making sure to uninstall the previous installation. I've tried using only two at a time, with the same methodology. I've tried every permutation of the above installations, with a computer restart in between. I don't think the problem is that it's not installing. I have no clue why but Jupyter notebooks just isn't recognizing this one package.
I'm running all of my commands from an Anaconda command prompt, and I make sure to activate my focal virtual environment. I also run Jupyter lab by typing it directly into the command prompt and hitting enter (I make sure I've activated my environment).
I'll try running it on a different OS and update.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
谢谢Duffymo!我的笔记本没有使用正确的内核。我认为我需要做的就是从我的虚拟环境中运行jupyter实验室,但需要有目的地添加它。我遵循此处显示的说明将我的conda环境添加到jupyter实验室:
如何将Conda环境添加到Jupyter Lab
Thanks duffymo! My notebook wasn't using the correct kernel. I thought all I needed to do was run Jupyter lab from my virtual environment, but it needs to be purposefully added. I followed the directions shown here to add my conda environment to Jupyter lab:
How to add conda environment to jupyter lab