Home > Net >  Trying to import tensorflow into VSCode, but getting a NoModuleFouNdError
Trying to import tensorflow into VSCode, but getting a NoModuleFouNdError

Time:01-04

I am using anaconda with VSCode. I import tensorflow after I downloaded it and made sure I was in the correct environment, but everytime I run the program in the terminal in both VSCode and the regular terminal I am getting this error saying no module name tensorflow. it will work in jupyter notebook perfectly without running into the error. I have tried launching VSCode from the anaconda navigator as well nothing is working. What am I doing wrong?

I am using python 3.9.7 with the recommended version from google of tensorflow 2.6

CodePudding user response:

see if your python interpreter path is correct. And u can edit if u click on this at the left bottom corner of vs code.

enter image description here

Click on this enter image description hereand vs code will show u all python interpreters it found all if your path is not there u can select it manually

CodePudding user response:

Have you checked which python environment you are using in the terminal?

get-command python
pip --version
pip show tensorflow

And which python interpreter you have selected in the Jupyter NoteBook?

  •  Tags:  
  • Related