您好,lsp-bridge必须使用pyright吗?我在init.el中改成 python-lsp-server 'pylsp
打开Python文件不是提示启动pyright并失败。
我这里提示pyright、python-lsp-server、node 和npm都已经安装了,但直接运行pyright还是会出现和lsp-bridge一样的错误,请问是什么原因?要怎么处理?谢谢。
subprocess.CalledProcessError: Command '['e:\\lxs\\anaconda\\python.exe', '-m', 'nodeenv', 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pyright-python.Administrator\\env']' returned non-zero exit status 2.
完整的pyright::stderr信息如下:
* Environment already exists: C:\Users\ADMINI~1\AppData\Local\Temp\pyright-python.Administrator\env
Traceback (most recent call last):
File "e:\lxs\anaconda\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "e:\lxs\anaconda\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "e:\lxs\anaconda\Scripts\pyright-langserver.exe\__main__.py", line 7, in <module>
File "e:\lxs\anaconda\lib\site-packages\pyright\langserver.py", line 57, in entrypoint
sys.exit(main(*sys.argv[1:]))
File "e:\lxs\anaconda\lib\site-packages\pyright\langserver.py", line 26, in main
return run(*args, **kwargs).returncode
File "e:\lxs\anaconda\lib\site-packages\pyright\langserver.py", line 37, in run
version = node.latest('pyright')
File "e:\lxs\anaconda\lib\site-packages\pyright\node.py", line 133, in latest
proc = run(
File "e:\lxs\anaconda\lib\site-packages\pyright\node.py", line 86, in run
binary = _ensure_available(target)
File "e:\lxs\anaconda\lib\site-packages\pyright\node.py", line 34, in _ensure_available
return Binary(path=_ensure_node_env(target), strategy=Strategy.NODEENV)
File "e:\lxs\anaconda\lib\site-packages\pyright\node.py", line 52, in _ensure_node_env
_install_node_env()
File "e:\lxs\anaconda\lib\site-packages\pyright\node.py", line 79, in _install_node_env
subprocess.run(args, check=True)
File "e:\lxs\anaconda\lib\subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['e:\\lxs\\anaconda\\python.exe', '-m', 'nodeenv', 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pyright-python.Administrator\\env']' returned non-zero exit status 2.
Process pyright stderr finished
* Environment already exists: C:\Users\ADMINI~1\AppData\Local\Temp\pyright-python.Administrator\env
Traceback (most recent call last):
File "e:\lxs\anaconda\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "e:\lxs\anaconda\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "e:\lxs\anaconda\Scripts\pyright-langserver.exe\__main__.py", line 7, in <module>
File "e:\lxs\anaconda\lib\site-packages\pyright\langserver.py", line 57, in entrypoint
sys.exit(main(*sys.argv[1:]))
File "e:\lxs\anaconda\lib\site-packages\pyright\langserver.py", line 26, in main
return run(*args, **kwargs).returncode
File "e:\lxs\anaconda\lib\site-packages\pyright\langserver.py", line 37, in run
version = node.latest('pyright')
File "e:\lxs\anaconda\lib\site-packages\pyright\node.py", line 133, in latest
proc = run(
File "e:\lxs\anaconda\lib\site-packages\pyright\node.py", line 86, in run
binary = _ensure_available(target)
File "e:\lxs\anaconda\lib\site-packages\pyright\node.py", line 34, in _ensure_available
return Binary(path=_ensure_node_env(target), strategy=Strategy.NODEENV)
File "e:\lxs\anaconda\lib\site-packages\pyright\node.py", line 52, in _ensure_node_env
_install_node_env()
File "e:\lxs\anaconda\lib\site-packages\pyright\node.py", line 79, in _install_node_env
subprocess.run(args, check=True)
File "e:\lxs\anaconda\lib\subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['e:\\lxs\\anaconda\\python.exe', '-m', 'nodeenv', 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pyright-python.Administrator\\env']' returned non-zero exit status 2.
Process pyright stderr finished
安装信息如下:
Microsoft Windows [版本 10.0.17763.1098]
(c) 2018 Microsoft Corporation。保留所有权利。
e:\lxs>echo %PATH%
echo %PATH%
e:\lxs\Anaconda3;e:\lxs\Anaconda3\Library\mingw-w64\bin;e:\lxs\Anaconda3\Library\usr\bin;e:\lxs\Anaconda3\Library\bin;e:\lxs\Anaconda3\Scripts;c:\Windows\system32;c:\Windows;c:\Windows\System32\Wbem;c:\Windows\System32\WindowsPowerShell\v1.0;c:\Windows\System32\OpenSSH;c:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;c:\Program Files\Intel\Intel(R) Management Engine Components\DAL;c:\Program Files\Intel\WiFi\bin;c:\Program Files\Common Files\Intel\WirelessCommon;d:\Program Files\Gow\bin;e:\lxs\Git\cmd;c:\Users\Administrator\scoop\shims;e:\lxs\texlive\2020\bin\win32;c:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;d:\Program Files\GNU Octave\Octave-6.2.0;e:\lxs\linux\wsl-terminal;d:\Program Files\Tesseract-OCR;;d:\Program Files\R\R-4.1.2\bin\x64;d:\Program Files\R\R-4.1.2\bin;d:\Program Files\ripgrep;e:\lxs\anaconda;e:\lxs\anaconda\Library\mingw-w64\bin;e:\lxs\anaconda\Library\usr\bin;e:\lxs\anaconda\Library\bin;e:\lxs\anaconda\Scripts;d:\Program Files\Inkscape\bin;d:\Program Files\Microsoft VS Code\bin;d:\Program Files\poppler-0.68.0\bin;d:\Tencent\QQGameTempest\Hall.57734;e:\lxs\emacs-28.1\libexec\emacs\28.1\x86_64-w64-mingw32
e:\lxs>where pyright
where pyright
e:\lxs\anaconda\Scripts\pyright.exe
e:\lxs>ls e:\lxs\anaconda\Scripts\pyright*
ls e:\lxs\anaconda\Scripts\pyright*
e:\lxs\anaconda\Scripts\pyright-langserver.exe
e:\lxs\anaconda\Scripts\pyright-python-langserver.exe
e:\lxs\anaconda\Scripts\pyright-python.exe
e:\lxs\anaconda\Scripts\pyright.exe
e:\lxs\anaconda\Scripts\pyright.exe.deleteme
e:\lxs>pip install node npm
pip install node npm
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: node in .\anaconda\lib\site-packages (1.0)
Requirement already satisfied: npm in .\anaconda\lib\site-packages (0.1.1)
Requirement already satisfied: zope.deprecation in .\anaconda\lib\site-packages (from node) (4.4.0)
Requirement already satisfied: odict>=1.8.0 in .\anaconda\lib\site-packages (from node) (1.9.0)
Requirement already satisfied: zope.lifecycleevent in .\anaconda\lib\site-packages (from node) (4.4)
Requirement already satisfied: zope.deferredimport in .\anaconda\lib\site-packages (from node) (4.4)
Requirement already satisfied: zope.component in .\anaconda\lib\site-packages (from node) (5.0.1)
Requirement already satisfied: setuptools in .\anaconda\lib\site-packages (from node) (52.0.0.post20210125)
Requirement already satisfied: plumber>=1.5 in .\anaconda\lib\site-packages (from node) (1.7)
Requirement already satisfied: optional-django==0.1.0 in .\anaconda\lib\site-packages (from npm) (0.1.0)
Requirement already satisfied: zope.event in .\anaconda\lib\site-packages (from zope.component->node) (4.5.0)
Requirement already satisfied: zope.interface>=5.3.0a1 in .\anaconda\lib\site-packages (from zope.component->node) (5.3.0)
Requirement already satisfied: zope.hookable>=4.2.0 in .\anaconda\lib\site-packages (from zope.component->node) (5.1.0)
Requirement already satisfied: zope.proxy in .\anaconda\lib\site-packages (from zope.deferredimport->node) (4.5.0)
e:\lxs>pyright
pyright
* Environment already exists: C:\Users\ADMINI~1\AppData\Local\Temp\pyright-python.Administrator\env
Traceback (most recent call last):
File "e:\lxs\anaconda\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "e:\lxs\anaconda\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "e:\lxs\anaconda\Scripts\pyright.exe\__main__.py", line 7, in <module>
File "e:\lxs\anaconda\lib\site-packages\pyright\cli.py", line 72, in entrypoint
sys.exit(main(sys.argv[1:]))
File "e:\lxs\anaconda\lib\site-packages\pyright\cli.py", line 20, in main
return run(*args, **kwargs).returncode
File "e:\lxs\anaconda\lib\site-packages\pyright\cli.py", line 36, in run
npx = node.version('npx')
File "e:\lxs\anaconda\lib\site-packages\pyright\node.py", line 116, in version
proc = run(target, '--version', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
File "e:\lxs\anaconda\lib\site-packages\pyright\node.py", line 86, in run
binary = _ensure_available(target)
File "e:\lxs\anaconda\lib\site-packages\pyright\node.py", line 34, in _ensure_available
return Binary(path=_ensure_node_env(target), strategy=Strategy.NODEENV)
File "e:\lxs\anaconda\lib\site-packages\pyright\node.py", line 52, in _ensure_node_env
_install_node_env()
File "e:\lxs\anaconda\lib\site-packages\pyright\node.py", line 79, in _install_node_env
subprocess.run(args, check=True)
File "e:\lxs\anaconda\lib\subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['e:\\lxs\\anaconda\\python.exe', '-m', 'nodeenv', 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pyright-python.Administrator\\env']' returned non-zero exit status 2.
e:\lxs>pip install pyright python-lsp-server
pip install pyright python-lsp-server
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: pyright in .\anaconda\lib\site-packages (1.1.248)
Requirement already satisfied: python-lsp-server in .\anaconda\lib\site-packages (1.4.1)
Requirement already satisfied: nodeenv>=1.6.0 in .\anaconda\lib\site-packages (from pyright) (1.6.0)
Requirement already satisfied: python-lsp-jsonrpc>=1.0.0 in .\anaconda\lib\site-packages (from python-lsp-server) (1.0.0)
Requirement already satisfied: pluggy>=1.0.0 in .\anaconda\lib\site-packages (from python-lsp-server) (1.0.0)
Requirement already satisfied: ujson>=3.0.0 in .\anaconda\lib\site-packages (from python-lsp-server) (4.0.2)
Requirement already satisfied: setuptools>=39.0.0 in .\anaconda\lib\site-packages (from python-lsp-server) (52.0.0.post20210125)
Requirement already satisfied: jedi<0.19.0,>=0.17.2 in .\anaconda\lib\site-packages (from python-lsp-server) (0.17.2)
Requirement already satisfied: parso<0.8.0,>=0.7.0 in .\anaconda\lib\site-packages (from jedi<0.19.0,>=0.17.2->python-lsp-server) (0.7.1)
e:\lxs>