Description
Environment data
- VS Code version: 1.33.1
- Extension version (available under the Extensions sidebar): 2019.4.12954
- OS and version: Windows_NT x64 10.0.17134
- Python version (& distribution if applicable, e.g. Anaconda): 2.7.11 64-bit
Expected behaviour
With python.autoComplete.extraPaths
set correctly, modules should import without issue.
Actual behaviour
I receive a Unresolved import 'moduleName'
when using syntax of the form
import workspace_folder.module as alt_name
and if the .code-workspace file is in the same directory.
e.g.
Steps to reproduce:
- Extract the following to a suitable location:
myLib.zip - Inside myLib, open the Import_Bug.code-workspace file
- Go to workspace settings and change the
python.autoComplete.extraPaths
to the folder containing myLib. - open libFunctions.py and see that
import myLib.importMe as im
has an unresolved import error.
I am aware that the organization of this workspace is sub-optimal, with the code-workspace file being inside the python library folder. However, with all paths being set correctly, the import should still succeed.
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
Blank.
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging
)
Blank.