Pylance-release: Numpy: "nan" is not a known member of module

Created on 2 Oct 2020  路  19Comments  路  Source: microsoft/pylance-release

Environment data

  • Language Server version: v2020.9.7

  • OS and version: Windows 10 build 2004, WSL 2 with Ubuntu 20.04
  • Python version: 3.8.2
  • Expected behaviour

    Pylance should recognise nan as part of the numpy module.
    Pyright CLI already recognises it.

    (venv) italo@Malacandra /m/c/U/i/G/C/P/email-lists (master)
    > pyright --version
    pyright 1.1.75
    (venv) italo@Malacandra /m/c/U/i/G/C/P/email-lists (master)
    > cat a.py
    import numpy as np
    
    print(np.nan)
    (venv) italo@Malacandra /m/c/U/i/G/C/P/email-lists (master)
    > pyright a.py
    No configuration file found.
    stubPath /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/typings is not a valid directory.
    Assuming Python platform Linux
    Searching for source files
    Found 1 source file
    0 errors, 0 warnings, 0 infos
    Completed in 0.855sec
    

    Actual behaviour

    image

    XXX

    Logs

    [Info  - 9:48:59 AM] No configuration file found.
    [Info  - 9:48:59 AM] Setting pythonPath for service "email-lists": "/mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/bin/python"
    Search paths found for configured python interpreter:
      /usr/lib/python3.8
      /usr/lib/python3.8/lib-dynload
      /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages
    [Error - 9:48:59 AM] stubPath /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/typings is not a valid directory.
    [Info  - 9:48:59 AM] Assuming Python version 3.8
    [Info  - 9:48:59 AM] Assuming Python platform Linux
    [Info  - 9:48:59 AM] Searching for source files
    [Info  - 9:48:59 AM] Auto-excluding /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv
    [Info  - 9:48:59 AM] Found 24 source files
    Background analysis message: setConfigOptions
    Background analysis message: setTrackedFiles
    Background analysis message: markAllFilesDirty
    Background analysis message: analyze
    [BG(1)] analyzing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/a.py ...
    [BG(1)]   parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/a.py (191ms)
    [BG(1)]   parsing: /home/italo/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.7/dist/typeshed-fallback/stdlib/2and3/builtins.pyi (182ms)
    [BG(1)]   binding: /home/italo/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.7/dist/typeshed-fallback/stdlib/2and3/builtins.pyi (22ms)
    [BG(1)]   binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/a.py (0ms)
    [BG(1)]   checking: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/a.py ...
    [BG(1)]     parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/__init__.py (1699ms)
    [FG] parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/a.py (83ms)
    [FG] parsing: /home/italo/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.7/dist/typeshed-fallback/stdlib/2and3/builtins.pyi (182ms)
    [FG] binding: /home/italo/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.7/dist/typeshed-fallback/stdlib/2and3/builtins.pyi (26ms)
    [FG] binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/a.py (2ms)
    [BG(1)]     binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/__init__.py ...
    [BG(1)]       parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/__init__.py (764ms)
    [BG(1)]       binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/__init__.py ...
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/numeric.py (568ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/numeric.py ...
    [BG(1)]           parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/umath.py (55ms)
    [BG(1)]           binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/umath.py (0ms)
    [BG(1)]           parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/numerictypes.py (163ms)
    [BG(1)]           binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/numerictypes.py (1ms)
    [BG(1)]           parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/fromnumeric.py (255ms)
    [BG(1)]           binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/fromnumeric.py (3ms)
    [BG(1)]           parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/arrayprint.py (198ms)
    [BG(1)]           binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/arrayprint.py (5ms)
    [BG(1)]           parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/_asarray.py (23ms)
    [BG(1)]           binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/_asarray.py (1ms)
    [BG(1)]           parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/_ufunc_config.py (71ms)
    [BG(1)]           binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/_ufunc_config.py (1ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/numeric.py (783ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/records.py (111ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/records.py (4ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/memmap.py (41ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/memmap.py (1ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/function_base.py (116ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/function_base.py (2ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/machar.py (95ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/machar.py (1ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/getlimits.py (165ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/getlimits.py (1ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/shape_base.py (141ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/shape_base.py (1ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/einsumfunc.py (54ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/einsumfunc.py (4ms)
    [BG(1)]       binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/__init__.py (2092ms)
    [Info  - 9:49:04 AM] [BG(1)] Long operation: binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/core/__init__.py (2092ms)
    [BG(1)]       parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/__init__.py (265ms)
    [BG(1)]       binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/__init__.py ...
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/type_check.py (19ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/type_check.py (1ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/index_tricks.py (134ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/index_tricks.py (2ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/function_base.py (205ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/function_base.py (7ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/nanfunctions.py (66ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/nanfunctions.py (2ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/shape_base.py (126ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/shape_base.py (1ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/stride_tricks.py (4ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/stride_tricks.py (1ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/twodim_base.py (10ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/twodim_base.py (0ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/ufunclike.py (5ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/ufunclike.py (2ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/histograms.py (12ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/histograms.py (2ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/polynomial.py (145ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/polynomial.py (3ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/utils.py (51ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/utils.py (2ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/arraysetops.py (6ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/arraysetops.py (1ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/npyio.py (255ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/npyio.py (5ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/financial.py (26ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/financial.py (1ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/arraypad.py (7ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/arraypad.py (3ms)
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/_version.py (5ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/_version.py (1ms)
    [BG(1)]       binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/lib/__init__.py (1115ms)
    [BG(1)]       parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/matrixlib/__init__.py (15ms)
    [BG(1)]       binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/matrixlib/__init__.py ...
    [BG(1)]         parsing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/matrixlib/defmatrix.py (9ms)
    [BG(1)]         binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/matrixlib/defmatrix.py (1ms)
    [BG(1)]       binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/matrixlib/__init__.py (10ms)
    [BG(1)]     binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/__init__.py (4263ms)
    [Info  - 9:49:06 AM] [BG(1)] Long operation: binding: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages/numpy/__init__.py (4263ms)
    [BG(1)]     parsing: /home/italo/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.7/dist/typeshed-fallback/stdlib/2and3/_typeshed/__init__.pyi (15ms)
    [BG(1)]     binding: /home/italo/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.7/dist/typeshed-fallback/stdlib/2and3/_typeshed/__init__.pyi (0ms)
    [BG(1)]     parsing: /home/italo/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.7/dist/typeshed-fallback/third_party/2and3/typing_extensions.pyi (1ms)
    [BG(1)]     binding: /home/italo/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.7/dist/typeshed-fallback/third_party/2and3/typing_extensions.pyi (0ms)
    [BG(1)]     parsing: /home/italo/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.7/dist/typeshed-fallback/stdlib/3/typing.pyi (7ms)
    [BG(1)]     binding: /home/italo/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.7/dist/typeshed-fallback/stdlib/3/typing.pyi (5ms)
    [BG(1)]   checking: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/a.py (6002ms)
    [Info  - 9:49:06 AM] [BG(1)] Long operation: checking: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/a.py (6002ms)
    [BG(1)] analyzing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/a.py (6397ms)
    [Info  - 9:49:06 AM] [BG(1)] Long operation: analyzing: /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/a.py (6397ms)
    Background analysis message: getDiagnosticsForRange
    Background analysis message: resumeAnalysis
    
    fixed in next version

    Most helpful comment

    We've just published a hotfix release (2020.9.8) for this rather than waiting until next week. Thanks for the report.

    All 19 comments

    Duplicate of #150.

    Note that numpy is not a fully typed library in its latest released version, so enabling a type checking mode other than "off" is likely to cause trouble. Their next release should include stubs, though.

    Pyright CLI already recognises it.

    This I'm confused by; we should have no behavioral differences to pyright in this case. Did you write stubs for numpy and they aren't being read? Are you certain the CLI version is running with identical settings?

    Pyright CLI already recognises it.

    This I'm confused by; we should have no behavioral differences to pyright in this case. Did you write stubs for numpy and they aren't being read? Are you certain the CLI version is running with identical settings?

    Nope. My setup was just installing WSL, installing node (from nodesource), then pyright, and opening VSCode on the folder. No type stubs or anything else. You can see on both outputs (pyright and pylance) that no typings folder was found.

    I should mention that this was working correctly yesterday, I think, or maybe the day before that. Was there a recent update that might've caused this?

    Wrt settings, I don't have any config files for pyright, and for pylance the only relevant configuration is python path pointing to the virtual environment (which was activated when I ran pyright).

    Pyright's copy of Pylance is slightly ahead of the released version of pyright, so maybe there's a problem there.

    Note that Pylance's defaults are not the same as pyright, but arguably pyright's defaults are stricter so it doesn't make sense for Pylance to complain about something and pyright not.

    Yes, we release weekly, the latest being Wednesday. You can use the VS Code extension menu to roll back to any other version if you'd like to test an older release.

    Pyright's copy of Pylance is slightly ahead of the released version of pyright, so maybe there's a problem there.

    Do you mean Pylance's copy of Pyright?

    if you'd like to test an older release

    Pylance v2020.9.6 works fine. No issues.

    Edit: the Pylance changelog says this:

    Pylance's copy of Pyright has been updated from 1.1.74 to 1.1.75

    1.1.75 is also the version I have installed. The changelog does list two unreleased bug fixes, so the regression must've been introduced between the released 1.1.75 and the build that Pylance uses.

    I suspect this is due to a pyright change that was introduced after 1.1.75. I'll investigate further.

    Do you mean Pylance's copy of Pyright?

    Yes, my mistake.

    1.1.75 is also the version I have installed. The changelog does list two unreleased bug fixes, so the regression must've been introduced between the released 1.1.75 and the build that Pylance uses.

    Note that we make modifications to pyright internally and sync the changes back; potentially the issue could be there (I had fixed a few bugs I introduced in 2020.9.6 to do with paths). Feasibly you could build the pyright CLI and test it to see if it reproduces.

    Feasibly you could build the pyright CLI and test it to see if it reproduces.

    I tried doing that. I followed the instructions on this page but here's what I got:

    italo@Malacandra ~/d/p/p/pyright (master)
    > node ./dist/pyright.js ~/a.py
    No configuration file found.
    Search paths found for configured python interpreter:
      /usr/lib/python3.8
      /usr/lib/python3.8/lib-dynload
      /home/italo/.local/lib/python3.8/site-packages
      /mnt/c/Users/italo/Google Drive/Code/Library
      /usr/local/lib/python3.8/dist-packages
      /usr/lib/python3/dist-packages
    stubPath /home/italo/dev/pyright/packages/pyright/typings is not a valid directory.
    Assuming Python platform Linux
    Searching for source files
    Found 1 source file
    /home/italo/a.py
      2:1 - error: "print" is not defined (reportUndefinedVariable)
    1 error, 0 warnings, 0 infos
    Completed in 0.409sec
    italo@Malacandra ~/d/p/p/pyright (master)
    > which python
    /usr/bin/python
    

    This is the same a.py as above.

    Obviously I'm missing a step on the build process, but I'm not sure what.

    That doc needs an update; run node index.js a.py instead (no dist).

    Note that you're now running pyright outside the venv and in a different directory; you should go back to where you were running pyright previously and run the local build from there.

    italo@Malacandra ~/d/p/p/pyright (master)
    > git log -1
    commit f0a231d7fcf4c8f3e659410afc1348b7a2eb15b2 (HEAD -> master, origin/master, origin/HEAD)
    Author: Eric Traut <[email protected]>
    Date:   Thu Oct 1 13:19:45 2020 -0700
    
        Fixed bug that caused symbols referenced by `__all__` not to be marked as accessed in some cases.
    (venv) italo@Malacandra ~/d/p/p/pyright (master)
    > node index.js --version
    pyright 1.1.75
    (venv) italo@Malacandra ~/d/p/p/pyright (master)
    > which python
    /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/bin/python
    (venv) italo@Malacandra ~/d/p/p/pyright (master)
    > node index.js ~/a.py
    No configuration file found.
    Search paths found for configured python interpreter:
      /usr/lib/python3.8
      /usr/lib/python3.8/lib-dynload
      /mnt/c/Users/italo/Google Drive/Code/Projects/email-lists/venv/lib/python3.8/site-packages
    stubPath /home/italo/dev/pyright/packages/pyright/typings is not a valid directory.
    Assuming Python platform Linux
    Searching for source files
    Found 1 source file
    0 errors, 0 warnings, 0 infos
    Completed in 0.932sec
    

    Are there any commits on pylance's pyright that aren't on the main repo?

    I found the culprit. As I suspected, it's a change that was made to pyright post 1.1.75 that was included in this week's pylance release. The problem is that numpy is using a form of __all__ manipulation that we didn't include in the new logic for determining which exports are visible from the library. (They use multiple idioms, and we support all but one.) The good news is that the form they're using is easy to support:

    __all__ += nanfunctions.__all__
    

    I've added support for this form, and the problem is now fixed. Apologies for the regression. And thanks for reporting it.

    This should be available in the next release on Wednesday, right?

    Yes, we'll pull it in.

    I'm still wondering how your CLI isn't reporting this, but the GUI is, though...

    I presume that the CLI isn't reporting it because the last version of the CLI is 1.1.75 which doesn't have this change.

    I just built the CLI from the main repo, though (see above). It still doesn't report any errors.

    I'm able to repro the problem with pyright 1.1.75. It doesn't occur with pyright 1.1.74. The regression was introduced between these two versions.

    @oyarsa, I'm not sure why you are not seeing the problem with the CLI. Are you sure you're running the correct version?

    italo@Malacandra ~
    > node dev/pyright/packages/pyright/index.js --version
    pyright 1.1.75
    

    @erictraut This is what pyright is reporting. Again, this was built from the pyright repo (master branch).

    The version there is always the same (comes out of the package.json and is only bumped at release). The git state would be what to check, but I can see in https://github.com/microsoft/pylance-release/issues/450#issuecomment-702873813 that you were running at the right revision.

    The only difference I can think of is the wrong python version being run or the wrong working directory. The linked comment is still running it on a file in ~, but your original post was on a specific project. That'd be the thing to test.

    We've just published a hotfix release (2020.9.8) for this rather than waiting until next week. Thanks for the report.

    Was this page helpful?
    0 / 5 - 0 ratings

    Related issues

    andyljones picture andyljones  路  5Comments

    yankyhoffman picture yankyhoffman  路  5Comments

    PedroMDuarte picture PedroMDuarte  路  5Comments

    fbidu picture fbidu  路  3Comments

    notatallshaw picture notatallshaw  路  4Comments