Open sdorof1 opened 4 years ago
Is the numpy lib in pyright path? Check lsp-pyright-extra-paths
or extraPaths
in pyrightconfig.json? See https://github.com/microsoft/pyright/blob/master/docs/configuration.md.
Is the numpy lib in pyright path? Check
lsp-pyright-extra-paths
orextraPaths
in pyrightconfig.json?
I added the next pyrightconfig.json
to project folder:
{
"executionEnvironments": [
{
"root": "src"
"extraPaths": [
"~/.pyenv/versions/3.8.1/lib/python3.8/site-packages/"
]
}
]
}
but without any effect. And I'm confused of need such configuration because numpy
is not an some extra but as a rule system lib. It is available on python path and the program works correctly both from shell and emacs. Did I understand you correctly about configuration?
I still can get some correct information from lsp:
And code completion somehow works but not all functions are displayed:
So, seems the library is available in some part.
Please pass in the --lib option when running from the shell.
On Thu, Oct 22, 2020, 7:07 AM sdorof1 notifications@github.com wrote:
Is the numpy lib in pyright path? Check lsp-pyright-extra-paths or extraPaths in pyrightconfig.json?
I added the next pyrightconfig.json to project folder:
{
"executionEnvironments": [
{ "root": "src" "extraPaths": [ "~/.pyenv/versions/3.8.1/lib/python3.8/site-packages/" ] }
]
}
but without any effect. And I'm confused of need such configuration because numpy is not an some extra but as a rule system lib. It is available on python path and the program works correctly both from shell and emacs. Did I understand you correctly about configuration?
I still can get some correct information from lsp:
[image: Снимок экрана от 2020-10-22 00-41-46] https://user-images.githubusercontent.com/6806825/96791708-9ad36480-1401-11eb-9bf8-2b81434fa937.png
And code completion somehow works but not all functions are displayed:
[image: Снимок экрана от 2020-10-22 01-00-26] https://user-images.githubusercontent.com/6806825/96791903-00bfec00-1402-11eb-8088-bbf927072b0a.png
So, seems the library is available in some part.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/emacs-lsp/lsp-pyright/issues/30#issuecomment-713904539, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOSBAJP5UWG4CIEQ52TVOLSL5LR7ANCNFSM4SY5MXOA .
Please pass in the --lib option when running from the shell.
If you mean pyright
then it works from shell as expected.
I meant we enable useLibraryCodeForTyoes by default. If you want to get same results when running pyright from the shell, you also need to pass in the --lib option.
Could you share the output when passing in the --lib option?
On Thu, Oct 22, 2020, 8:23 AM sdorof1 notifications@github.com wrote:
Please pass in the --lib option when running from the shell.
If you mean pyright then it works from shell as expected.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/emacs-lsp/lsp-pyright/issues/30#issuecomment-713967621, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOSBALHCGJF2FU52O43MT3SL5UPRANCNFSM4SY5MXOA .
Could you share the output when passing in the --lib option?
Yes, I got it
pyr$ pyright --lib
4:11 - error: "sign" is not a known member of module (reportGeneralTypeIssues)
1 error, 0 warnings, 0 infos
Should I just disable useLibraryCodeForTyoes
or there is some config that should be done?
Disabling useLibraryCodeForTypes
will also disable auto-completion for numpy
. You might want to filter errors (like unknown member etc) for your project.
@zeronone how would one filter errors like that?
@orlandini check this page? https://github.com/microsoft/pyright/blob/main/docs/configuration.md#diagnostic-rule-defaults
For the next code (which runs without errors):
I got the error with pyright in emacs:
But if I run pyright in the shell, it doesn't report any errors:
So, I get a some mystic error report. This is also in other cases, for example, when work with
pandas
, when no pyright itself, no vscode doesn't reports any errors.The value of
lsp-pyright-typechecking-mode
isbasic
for all cases.