Ch3shire
Ch3shire

Reputation: 1106

Python: Incorrect Intellisense autocompletion for numpy

One thing I can't get over - when I use numpy in Visual Studio and I want to declare an array of zeroes, I write:

x = numpy.zeros(n)

and it is correct for the interpreter. BUT THE AUTOCOMPLETION GIVES ME:

X = numpy.zeros_like ...

How can I change it to get actually helpful autocompletion? In C++ I get everything allright, so I guess it's an internal problem in Python case.

Edit: As I see the problem is that numpy.zeros is defined in numeric.py as: zeros = multiarray.zeros. Apparently this is not enough for IntelliSense (or VisualAssist for this matter), which requires def function to actually see the structure.

Upvotes: 1

Views: 1587

Answers (1)

Sara Liu - MSFT
Sara Liu - MSFT

Reputation: 6218

You need to install the python 3.5 and download the corresponding wheel for numpy. Then using the command: pip install xxxx(numpy wheel version that you download) to install it. For more the detail information about the installation staff, you can have a look at this.

Then open or create a python application project in VS and set the python 3.5 as the default environment, then I can found the intellisense for numpy.zeros also works fine in .py file like the following screenshot: (python 3.5) enter image description here

If set the python 2.7 as the default environment, the intellisense just like your description as below: enter image description here

Upvotes: 1

Related Questions