python - (Neo)vim python 支持和活动 virtualenv 冲突
问题描述
我在 Neovim 下通常支持 Python
init.vim
:
" Plug 'plytophogy/vim-virtualenv'
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
endif
Plug 'zchee/deoplete-jedi'
Plug 'davidhalter/jedi-vim'
当我nvim
在某些虚拟环境处于活动状态时启动时,它以此错误消息开头
UltiSnips requires py >= 2.7 or py3
Press ENTER or type command to continue
当然还有更多。
我个人并不感到惊讶。插件的 Python 代码不应该在与它无关的虚拟环境中运行。然而我必须这样做。我能做些什么?
vim-virtualenv
显然与这个问题没有任何关系。也没有解决它。
解决方案
有关Neovim 提供程序,请参阅此文档:
PYTHON PROVIDER CONFIGURATION ~
*g:python_host_prog*
Command to start Python 2 (executable, not directory). Setting this makes
startup faster. Useful for working with virtualenvs. >
let g:python_host_prog = '/path/to/python'
<
*g:python3_host_prog*
Command to start Python 3 (executable, not directory). Setting this makes
startup faster. Useful for working with virtualenvs. >
let g:python3_host_prog = '/path/to/python3'
推荐阅读
- testing - 使用 Metamask 进行测试的赛普拉斯测试方法
- python - 如何删除 matplotlib 折线图中的轴刻度?
- swift4 - 如何使用 swift xcuitest 从 pdf 文件中读取数据
- c++ - Eigen 中有没有办法一次评估多个表达式?
- ms-access - 使用条件访问查询计数
- laravel - 我想使用 Laravel 显示与名称相关的描述
- html - ONCLICK 事件没有传播?
- docker - docker-compose 不能在 CentOS 7 上运行
- python - 如何排除具有空 prefetch_related 字段的行
- python - 我成功将文件上传到heroku,它上线了,但命令不起作用