Jedi Vim Python subclasses are not detected on TAB-completion

后端 未结 2 1290
梦毁少年i
梦毁少年i 2020-12-20 02:22

The issue is on Arch (1) & Debian Jessie (2) where:

1.

> uname -r
4.0.5-1-ARCH
> echo $PYTHONPATH
/usr/lib/python2.7/
2条回答
  •  清酒与你
    2020-12-20 02:56

    Old question, but I've found an alternative to amending sys.path if you are using virtual environments.

    You can instead create a .pth (https://docs.python.org/2/library/site.html) file in your /lib//site-packages folder that points to the root of your source e.g. if my source was in /user/123/python-proj/source folder and my virtual env was in the /user/123/python-proj/venv folder

    echo '/user/123/python-proj/source > /user/123/python-proj/venv/lib/python3.5/site-packages/my-source.pth'
    

    Make sure you activate the virtual env first, then launch vim and jedi should be able to find your code.

提交回复
热议问题