Adam
Adam

Reputation: 485

Import Error - Tensorflow Installation

I just installed Tensorflow and the short program that I was supposed to use in order to validate my installation works fine.

My editor though has a red underline under the import command in the

import tensorflow as tf

When I hover my mouse over it I get the the error message

[pylint] E0401: Unable to import 'tensorflow'

I want to point out that when I compile the program I don't get that error.

Why is that happening when obviously tensorlow works fine? How can I fix that?

Upvotes: 0

Views: 89

Answers (1)

Adam
Adam

Reputation: 485

Thanks to Dinusha Dilanka, the answer to that question was that I had to manually specify an interpreter.

This can be achieved by selecting the Settings and creating, or modifying, the entry python.pythonPath as follows.

"python.pythonPath": "PATH/python"

for Linux, or

"python.pythonPath": "PATH/python.exe"

for Windows.

Upvotes: 1

Related Questions