Use Virtualenv with Python with Visual Studio Code in Ubuntu

I have a Python project and navigation/autocomplete work perfectly within files in the project. I want to specify a virtualenv so that navigation/autocomplete work with packages inside that virtualenv.

I tried this in settings.py but navigation/autocomplete does not work. Also by setting "python.pythonPath":"~/dev/venvs/proj/bin/python killed the original navigation/autocomplete.

    {
        "editor.rulers": [80,100],
        "python.autoComplete.extraPaths": [
            "~/dev/venvs/proj",
            "~/dev/venvs/proj/lib"
         ]
    }

With the latest update to the extension all you need to do is just specify the "python.pythonPath" as follows. The values for "python.autoComplete.extraPaths" will be determined during runtime, but you are still free to specify custom paths in there.

Please, remember to re-start VS Code once the necessary changes have been made.

    {
        "editor.rulers": [80,100],
        "python.pythonPath":"~/dev/venvs/proj/bin/python"
    }

From: stackoverflow.com/q/37642045