Intellisense + numpy/scipy does not work


Intellisense for numpy and scipy does not work for me in the text editor.
If I open a file and put in

import numpy
import scipy
import time
from matplotlib import pyplot

putting the cursor on numpy gives a popup numpy: <unknown type>, same for scipy.
for time it tells me time: built-in module time, same for pyplot.

The autocompletion for time and pyplot works, for numpy it does not.

The completion DB is up to date.

Importing numpy in the interactive window works and the autocomplete in the interactive window works, too.

I am using python(x,y) 2.7.3 on windows 7 (32b)

Microsoft Visual Studio 2013 Shell (Integrated)
Version 12.0.21005.1 REL
Microsoft .NET Framework
Version 4.5.50938

Installed Version: IDE Standard

Microsoft Python Tools for Visual Studio 2.0.11016.00
Python Tools for Visual Studio provides intellisense, project support, project and item templates, as well as a REPL window for Python development.

Microsoft Python Tools for Visual Studio - Django Integration 2.0.11016.00
Provides templates and integration for the Django web framework.

Microsoft Python Tools for Visual Studio - Profiling Support 2.0.11016.00
Profiling support for Python projects.

file attachments

Closed Jan 20 at 4:21 PM by Zooba


Zooba wrote Oct 28, 2013 at 6:11 PM

Do numpy and scipy appear in the suggestions for "import"?

Also, can you open up Tools->Python Tools->Diagnostic Info and attach the contents to this issue (or email it to ptvshelp@microsoft.com, if you don't want to publicise the file paths that are included)?

pythond wrote Oct 28, 2013 at 7:12 PM

Both numpy and scipy appear in the suggestions for import, i.e. when I type in import nu it gives me a list of available libraries with names starting in nu, including numpy.

The diagnostic info is attached.

pythond wrote Oct 28, 2013 at 7:13 PM

I don't think it could be the cause, but I have regular VS2012 installed and PTVS in the 2013 shell.

Zooba wrote Oct 28, 2013 at 9:28 PM

Thanks for that. I can't see anything wrong in the logs (including assembly versions, so you're probably right about VS 2012 being the cause).

Do you know of any other packages that are not working? (List of packages in pythonxy) What about subpackages of numpy like numpy.core or numpy.core.multiarray?

pythond wrote Oct 28, 2013 at 10:43 PM

I have tried a couple from the list, most that I tried worked.
I have found a few more that don't work, including built-in ones, see below.


does not work:
matplotlib (but from matplotlib import pyplot does work for pyplot!)

I found something that might be helpful:
All the libs that don't work have a different symbol in the tooltip.
Most libraries have the three stacked blocks, the non-working ones have the isometric rectangle.
Even though they don't work in the editor, they work in the command line, so the libraries are there and accessible. Both IPython and the built-in interactive Python work.

I have attached a screenshot.

Zooba wrote Oct 29, 2013 at 3:50 PM

Thanks for checking all of those. It's interesting that there are standard library modules that aren't working... we haven't seen something like this before.

Generally, the interactive windows will always work fine because they're actually running the code. We try to avoid running any code for the editor (in case someone puts something like shutil.rmtree("C:\\") in there) which is why the results are different. But it does confirm that there's nothing wrong with your installation.

What the different icon usually means is that we saw an import statement for that module but couldn't find it. If you write something like import blahblahblah then you'll start seeing blahblahblah in the suggestions. We shouldn't ever do it for modules like os and pickle.

The problem may be one of the packages in python(x,y). We've tested against, but not (or starting that one now). If you're in a position where you can update then you may have more success. I'll start running tests against those two versions and let you know if anything comes up.

pythond wrote Oct 29, 2013 at 5:41 PM

Thank you for the explanation and for trying to solve this issue.
I have upgraded scipy to 0.12.1-3 and matplotlib to 1.3.1-4, updated the DB, but still have the same problem. unfortunately the system is a production system where I can't just upgrade the entire python xy distribution. I will try installing on a new system and see what happens.

pythond wrote Oct 29, 2013 at 6:59 PM

I have tried another system, it is 64bit win 7. Unfortunately there is no python(xy) for 64bit yet, so I used WinPython
PTVS works perfectly, including numpy, scipy, pandas, os, traceback and pickle, it looks like it is a problem with python(xy), maybe because it uses custom binaries.
I'll have to think about upgrading.

pythond wrote Oct 30, 2013 at 3:05 PM

The numpy update damaged my installation, so I had to re-install anyway.
I am now running python(x,y), which works beautifully with IntelliSense, including all the problematic modules above.
Thank you very much for your help!

Zooba wrote Oct 30, 2013 at 3:40 PM

Sorry to hear that it didn't update properly, but glad you've got it working.

Also, thanks for the report. Our aim is to be able to handle any code, but we can't test everything up-front. pythonxy is now on our list.