简体   繁体   English

VS Code 中的 Jupyter 使用错误版本的 scipy

[英]Jupyter in VS Code using wrong version of scipy

In VS Code on Ubuntu, when I run a Jupyter notebook, it is using a different version of scipy from when I run the commands in a terminal, despite the fact that the kernel and interpreters appear to be identical.在 Ubuntu 上的 VS Code 中,当我运行 Jupyter 笔记本时,它使用的 scipy 版本与我在终端中运行命令时不同,尽管内核和解释器看起来是相同的。 If I run Jupyter from a terminal, it works correctly.如果我从终端运行 Jupyter,它可以正常工作。 Where can I change this behavior in VS Code?我在哪里可以在 VS Code 中更改此行为? Many thanks!非常感谢!

It turns out that the Anaconda version of scipy was 1.7.3, so VS Code was seeing the 'right' one, but I had installed scipy version 1.8.0 via pip before installing Anaconda, which for some reason was picked up in the terminal.事实证明,scipy 的 Anaconda 版本是 1.7.3,所以 VS Code 看到的是“正确”的版本,但是我在安装 Anaconda 之前通过 pip 安装了 scipy 版本 1.8.0,由于某种原因在终端中被选中. I removed both and reinstalled scipy using 'python -m pip install scipy', and I now have the most recent version in Anaconda, which is seen both in the terminal and Jupyter in VS Code.我删除了这两个并使用'python -m pip install scipy'重新安装了scipy,现在我在Anaconda中有最新版本,在VS Code的终端和Jupyter中都可以看到。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM