简体   繁体   English

Tornado 将在 Jupyter 中导入,但不会在 VS Code 中导入

[英]Tornado will import in Jupyter but not VS Code

I can import Tornado in my Jupyter Notebook without any problem but when I try to do so in VS Code I get the following error ModuleNotFoundError: No module named 'tornado' .我可以毫无问题地在我的 Jupyter Notebook 中导入 Tornado,但是当我尝试在 VS Code 中这样做时,我收到以下错误ModuleNotFoundError: No module named 'tornado'

I installed Tornado using Anaconda, conda install -c conda-forge tornado , but I don't know how that could make a difference between Jupyter and VS Code.我使用 Anaconda, conda conda install -c conda-forge tornado forge tornado 安装了 Tornado,但我不知道这对 Jupyter 和 VS Code 有何影响。 Any ideas how I can get Tornado running on VSC?有什么想法可以让 Tornado 在 VSC 上运行吗?

You need to select correct python interpreter in visual studio code, Below link might be helpful in selecting the correct python interpreter for your code.您需要在 Visual Studio 代码中使用 select 正确的 python 解释器,以下链接可能有助于为您的代码选择正确的 python 解释器。

https://code.visualstudio.com/docs/python/environments https://code.visualstudio.com/docs/python/environments

Also, I believe you should use virtual environments for managing the package efficiently, to integrate the right virtual environment in Jupiter notebook此外,我相信您应该使用虚拟环境来有效管理 package,以便在 Jupiter Notebook 中集成正确的虚拟环境

you can follow this https://www.slideshare.net/dhineshsunderganapathi/intro-tovenvpy3?qid=8f764e4a-12d4-4280-841f-e4314afcd7ab&v=&b=&from_search=1你可以关注这个https://www.slideshare.net/dhineshsunderganapathi/intro-tovenvpy3?qid=8f764e4a-12d4-4280-841f-e4314afcd7ab&v=&b=&from_search=1

Let me know how this goes.让我知道这是怎么回事。

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

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