Closed hungpham3112 closed 2 years ago
What error? Please provide the error shown in vim.
[Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = 'python'
isolated = 0iles\vimrc
environment = 1s\install.bat
user site = 1ject\effective_c\hello.c
import site = 1ct\effective_c\hello.exe
sys._base_executable = 'C:\\Users\\hungpham\\scoop\\apps\\vim-nightly\\current\\vim.exe'
sys.base_prefix = 'C:\\Users\\hungpham\\scoop\\apps\\python\\current'
sys.base_exec_prefix = 'C:\\Users\\hungpham\\scoop\\apps\\python\\current'
sys.platlibdir = 'lib'rShell\Microsoft.PowerShell_profile.ps1
sys.executable = 'C:\\Users\\hungpham\\scoop\\apps\\vim-nightly\\current\\vim.exe'
sys.prefix = 'C:\\Users\\hungpham\\scoop\\apps\\python\\current' dos utf-8 startify 34% 15:5
sys.exec_prefix = 'C:\\Users\\hungpham\\scoop\\apps\\python\\current'
sys.path = [
'C:\\Users\\hungpham\\scoop\\apps\\python\\current\\python310.zip',
'C:\\Users\\hungpham\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\',
'C:\\Users\\hungpham\\AppData\\Local\\Programs\\Python\\Python310\\DLLs\\',
'C:\\Python310\\Lib\\',
'C:\\Python310\\DLLs\\',
'C:\\Users\\hungpham\\scoop\\apps\\vim-nightly\\current',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x000035a4 (most recent call first):
<no Python frame>
here is the error. Did you try to see 2 link I give to you?
It's not likely caused by coc.nvim itself since it has nothing to do with your python.
Should be python issue with your vim, try uninstall coc-snippets which using python code or use let $COC_NO_PLUGINS = '1'
in your vimrc to disable all extensions of coc.nvim.
Use command like :pyx print(3)
should reproduce the issue.
It's not likely caused by coc.nvim itself since it has nothing to do with your python. Should be python issue with your vim, try uninstall coc-snippets which using python code or use
let $COC_NO_PLUGINS = '1'
in your vimrc to disable all extensions of coc.nvim.
This work to me, no error show after use let $COC_NO_PLUGINS = '1'
. But :pyx print(3)
still raise the error. So what's happening in here? It's caused by vim?
@hungpham3112 In coc-snippets, there is code that uses :pyx
because of its ability to work with Ultisnips, so it will cause an error, but your Vim8 is causing the error with the :pyx
command in the first place.
Another Vim plugin that uses :pyx
will probably give you the same error
This is not a problem with coc-snippets.
@hungpham3112 In coc-snippets, there is code that uses
:pyx
because of its ability to work with Ultisnips, so it will cause an error, but your Vim8 is causing the error with the:pyx
command in the first place.Another Vim plugin that uses
:pyx
will probably give you the same errorThis is not a problem with coc-snippets.
How to solve this problem?
How to solve this problem?
I don't use Windows, so I don't know, but if you install vim
and python
in a way other than scoop
, for example, you might be able to isolate the problem!
Compile your vim with python you've just installed should help.
@hungpham3112 Please track https://github.com/vim/vim/pull/9710
I was able to work around this problem by setting the PYTHONHOME
environment variable, like so (on cmd, adapt for poweshell etc):
set PYTHONHOME=C:\Users\giovanni\scoop\apps\python39\current\
I'm not sure why this is happening, but it fixed it for now.
I'm on the same setup, vim and python installed through scoop. I got the exact same error.
The :pyx print(3)
was a good test, it crashed immediately with the same error. The let $COC_NO_PLUGINS = '1'
also fixed it temporarily, so I could run vim without issues and test the waters.
I was able to work around this problem by setting the
PYTHONHOME
environment variable, like so (on cmd, adapt for poweshell etc):set PYTHONHOME=C:\Users\giovanni\scoop\apps\python39\current\
I'm not sure why this is happening, but it fixed it for now.
I'm on the same setup, vim and python installed through scoop. I got the exact same error.
The
:pyx print(3)
was a good test, it crashed immediately with the same error. Thelet $COC_NO_PLUGINS = '1'
also fixed it temporarily, so I could run vim without issues and test the waters.
See this, It's cause by the sample vimrc and gvimrc in directory when you install vim. Solved here
Step to reproduce:
Window:
scoop install python
andscoop install vim
You can see more in here and here