Stack Overflow Asked by safetymonkey on December 1, 2021
I’m setting up a new macOS Catalina machine and I am receiving the following errors in the Problems
window which appear to be originating from the Python Language Server (as opposed to a linter). All imports are failing, these are just some examples.
_helpers.py
unresolved import 'datetime' Python(unresolved-import) [2, 8]
unresolved import 'json' Python(unresolved-import) [3, 8]
unresolved import 'logging' Python(unresolved-import) [4, 8]
These are showing up for built-in libraries as well as third party libraries I’m importing, most notably Google App Engine via the Gcloud SDK. All of the searching I’ve done suggests it’s a problem with the paths, but nothing I’ve tried works. Also worth noting that if I go into the Terminal
window in vscode, open an interactive Python shell and import these libraries, everything works.
My system:
pyenv
(pyenv
installed via homebrew
)Here’s my settings files:
// User settings.json
{
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"python.languageServer": "Microsoft",
"python.pythonPath": "~/.pyenv/shims/python",
"python.analysis.downloadChannel": "stable",
}
// Workspace settings.json (in .vscode)
{
"files.exclude": {
"**/*.pyc": true
},
"python.pythonPath": "${workspaceFolder}/Venv/bin/python",
"python.autoComplete.extraPaths": [
"${workspaceFolder}/lib/",
"~/google-cloud-sdk/",
"~/google-cloud-sdk/platform/google_appengine",
"~/google-cloud-sdk/platform/google_appengine/lib/",
"~/google-cloud-sdk/lib"
],
"files.associations": {
"*.html": "jinja-html"
}
}
I’m losing my mind here. Any help would be greatly appreciated.
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP