Giter Club home page Giter Club logo

Comments (9)

seagle0128 avatar seagle0128 commented on June 3, 2024

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.

from lsp-pyright.

sdorof1 avatar sdorof1 commented on June 3, 2024

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:

Снимок экрана от 2020-10-22 00-41-46

And code completion somehow works but not all functions are displayed:

Снимок экрана от 2020-10-22 01-00-26

So, seems the library is available in some part.

from lsp-pyright.

zeronone avatar zeronone commented on June 3, 2024

from lsp-pyright.

sdorof1 avatar sdorof1 commented on June 3, 2024

Please pass in the --lib option when running from the shell.

If you mean pyright then it works from shell as expected.

from lsp-pyright.

zeronone avatar zeronone commented on June 3, 2024

from lsp-pyright.

sdorof1 avatar sdorof1 commented on June 3, 2024

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?

from lsp-pyright.

zeronone avatar zeronone commented on June 3, 2024

Disabling useLibraryCodeForTypes will also disable auto-completion for numpy. You might want to filter errors (like unknown member etc) for your project.

from lsp-pyright.

orlandini avatar orlandini commented on June 3, 2024

@zeronone how would one filter errors like that?

from lsp-pyright.

tshu-w avatar tshu-w commented on June 3, 2024

@orlandini check this page? https://github.com/microsoft/pyright/blob/main/docs/configuration.md#diagnostic-rule-defaults

from lsp-pyright.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.