I created a venv using python3.6 on my mac os in this folder
/Users/kim/Documents/Apps/PythonApps/python36-miros-a3
I ran a pip install pylint
after I activated the virtual env
My workspace is in /Users/kim/Documents/Apps/WebApps/miros-a3
Inside my vscode workspace, I have the following Workspace settings
{
"folders": [
{
"path": "."
}
],
"settings": {
"python.pythonPath": "/Users/kim/Documents/Apps/PythonApps/python36-miros-a3/bin/python3.6",
"python.venvPath": "/Users/kim/Documents/Apps/PythonApps"
}
}
I have tried setting a custom path for the pylint and also changing the venvpath.
The pylint kept complaining about the import statement saying it does not exist.
As you can see, they are in the same folder, and I can definitely execute my python files.
What can I do to avoid these kind of false positive import errors?
I have also tried the following:
- go to commandline turn on the virtual env and then type
code
to activate the vscode as recommended here https://code.visualstudio.com/docs/setup/mac - also tried this https://donjayamanne.github.io/pythonVSCodeDocs/docs/troubleshooting_linting/
{workspaceFolder}
:"import sys; sys.path.append({workspaceFolder})"
– Laurinelaurita