Intellisense on Library (I am a newbie with pytools and python)

Nov 6, 2013 at 4:29 AM
Hi,

I have a library installed called pymodbus however after typing in import and the intellisense list comes up pymodbus is not listed.

The small script I have created runs so Python does invoke the pymodbus library.

I have pressed the 'Refresh DB' under the Python environment a few times but that has not made any difference.

My setup is Python 2.7, Windows 7 64 bit, Visual Studio 2013 (shell version with pytools).

I am an absolute newbie so I hope I have not missed something obvious but could someone please advise on what I should do to get the intellisense pickup the pymodbus library?

Thank you for your time.

Kind regards,

Paul
Coordinator
Nov 6, 2013 at 3:12 PM
Can you check that the pymodbus files are at C:\Python27\Lib\site-packages\pymodbus (changing the first part if you installed Python somewhere else)? If the files are there, then we should pick them up no problem. One way you can check is to run the following in Python:
import pymodbus
print pymodbus.__file__
If you didn't install using pip, easy_install or setup.py, we're probably not going to find them. Other installers may put them somewhere else and change your PYTHONPATH environment variable, which we ignore (the reasons why we ignore it).

If it is installed in the right place, we'll need to get some more information. Under the Tools menu, click Python Tools and Diagnostic Info. If you save this into a text file and email it to ptvshelp@microsoft.com, we'll be able to narrow down what's going on.
Nov 7, 2013 at 12:40 AM
Thank you for your reply.

To install pymodbus I used "easy_install.exe -U pymodbus". This install did not report any errors.

My C:\Python27\lib\site-packages directory contains a file called pymodbus-1.2.0-py27.egg .

When I run the Python commands from your post the output is as follows:
C:\Python27\lib\site-packages\pymodbus-1.2.0-py2.7.egg\pymodbus__init__.pyc

I have emailed my Diagnostic Info to ptvshelp@microsoft.com.
Coordinator
Nov 7, 2013 at 3:52 PM
Ah, okay, so this is a known limitation of our analysis, in that we won't scan files inside a .egg. I've just created an item in our work tracker: 2010 (might be a good starting point for someone who wants to contribute code to PTVS...)

The easiest fix is to run easy_install.exe -Z -U pymodbus (or you can reinstall through PTVS by installing -U pymodbus). The -Z ensures that we extract the files from the egg, and we always pass it when you use the Install Python Package command.
Nov 8, 2013 at 7:27 AM
Thanks for the advice, I reinstalled pymodbus through PTVS and intellisense is now working :-)

Thanks very much.

Kind regards,

Paul