简体   繁体   中英

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' .

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. Any ideas how I can get Tornado running on 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.

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

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

Let me know how this goes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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