0

The scipy.stats have a module called norm but VScode does not seem to find it.

enter image description here.

I am aware of this very similar question, but I am no able to solve my problem based on the answer givin there.

Scipy is installed in a Conda environment.

Using VScode 1.61.2 and Conda 4.10.3.

Havsula
  • 43
  • 1
  • 9
  • This will not affect the execution of your script in any way. The `norm` module is "built" when `scipy` is instantiated. It's not in a separate file. – Tim Roberts Oct 29 '21 at 20:36
  • So it is actually impossible to autocomplete this since it do not exist befor run-time? – Havsula Oct 29 '21 at 20:40
  • I'm wouldn't say it's impossible, but certainly "more trouble than it's worth". – Tim Roberts Oct 29 '21 at 20:43
  • Thank you for the help. I see now that I needs to study the Scipy module a little deeper in order how this "building on instantiation" works. – Havsula Oct 29 '21 at 20:56
  • If this is the same issue as in https://stackoverflow.com/questions/69001787/vs-code-python-doesnt-autocomplete-scipy-stats, then this is apparently a flaw in the pylance plugin for VSCode (see my comment in the linked question). – Warren Weckesser Oct 29 '21 at 21:33
  • I also have the same problem in Neovim using coc-pyright, but as far as I have understood Pylance uses Pyright also? – Havsula Oct 29 '21 at 21:36
  • Can you import it like this `from scipy.stats._continuous_distns import norm`? – Steven-MSFT Nov 01 '21 at 07:35
  • That worked!! Why is VsCode Python autocompleter (PyRight) picking up norm when imported like that? – Havsula Nov 02 '21 at 19:45

0 Answers0