forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
Description
Environment data
- VS Code version: 1.38.0
- Extension version (available under the Extensions sidebar): 1.38.0
- OS and version: macOS Mojave, 10.14.6
- Python version (& distribution if applicable, e.g. Anaconda): 3.6.8
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): pyenv
- Relevant/affected Python packages and their versions: tensorflow 1.14, 2.0
- Jedi or Language Server? (i.e. what is
"python.jediEnabled"set to; more info How to update the language server to the latest stable version #3977): language server (setting isfalse)
Expected behaviour
Create python file
from tensorflow.keras.layers import Input
inp = Input(shape=(1,))
print('Done!')Expect no errors, expect a useful information tooltip when hovering over Input.
Running this python file prints "Done!", i.e. this is not actually an unresolved import.
Actual behaviour
unresolved import error is shown. No useful information tooltip.
Other note
If I change the import to
from tensorflow.python.keras.layers import Input # inserted ".python"things work as expected. This is a non-standard, undocumented import path (so I'd rather not do it).
Steps to reproduce:
- Create a python file containing above code.
- Observe error.
Related issues
This seems related to #6241, but as best as I can tell there's no sys.path shenanigans going on inside tensorflow (and thus not a duplicate). The two following files look reaosnable to me, but I'll admit I don't know much about how the tensorflow pypi package is created. There could be weird stuff inserted at build time.
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
