Replies: 4 comments
-
Yes, the pyright-langserver will read the pyrightconfig.json or pyproject.toml automatically. It looks in the project root directory passed to the language server. This is assumed to be passed to the language server in the initialization command (in the |
Beta Was this translation helpful? Give feedback.
-
Hi @erictraut , thanks very for this quick reply. Following are some info about my testing project.
import baostock as bs
import pandas as pd
lg = bs.login()
print('login response error code: ' + lg.code)
{
"include": [
"venv"
],
"exclude": [
"**/__pycache__"
],
"pythonVersion": "3.12",
"pythonPlatform": "Linux",
"venvPath": "/home/XXXX/tmp/venv",
"venv": ".venv"
}
When I enabled my lsp client (lspce), it told that baostock and pandas could not be resolved. Any advice? Thanks. |
Beta Was this translation helpful? Give feedback.
-
The source code for pyright is open source. Here is the initialization callback for the language server. If you'd like to insert debug statements or connect a debugger to help you diagnose the problem, there are some instructions here. I would also normally suggest adding a |
Beta Was this translation helpful? Give feedback.
-
Converting this to a discussion since this isn't a bug report. |
Beta Was this translation helpful? Give feedback.
-
Hi guys, I have some questions about pyrightonfig.json and I haven't found answers in the document.
Thanks!
I ask these question because I couldn't make it work and don't know why. I created a simple project, in which I used
python -m venv
to create a virtualenv, then I created a pyrightconfig.json at the root of the project and specifiedvenvPath
andvenv
in it, but it seemed that it didn't work(It couldn't find packages installed in this virtual env).I used my own lsp client in Emacs. I can provide other info if you need. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions