dhruv's wiki

Python

Resources

!!! note "Deprecated" The content below is mainly for coc-python, which has now been deprecated. coc-pyright works better. Pyright page

Setting up interpreter

Each project might need a specific python interpreter.

  • Create a .vim directory at project root.
  • Add the following to .vim/coc-settings.json
    {
        "python.pythonPath": "/Users/dhruvthakur/.virtualenvs/sqlalchemy/bin/python"
    }

When Coc doesn't pick up the right workspace path

Unresolved import · Issue #26 · neoclide/coc-python

Run :CocList folders.
Press <cr> and edit the path to correct folder.
Run :CocRestart to restart service.
Save a session file to persist workspaceFolders.