QtPy in VS

May 18, 2015 at 1:36 AM
I watched the video on the main page for Python in VS (https://www.youtube.com/watch?v=JNNAOypc6Ek) and it shows

from PyQt4.QtGui import QApplication, QPushButton
app QApplication(sys.argv)

but I get an error saying unknown type. So I assume I need to load PyQt somewhere but I can't figure out how to get it loaded into VS. Can anyone point me in the right direction?
Coordinator
May 18, 2015 at 1:53 AM
PTVS itself doesn't come with Python; you need to download and install that separately. If you want popular third-party packages such as PyQt, your best bet is to install a distro like Anaconda or WinPython that has them out of the box. Alternatively, you can install them using pip (though that will likely be tricky in case of PyQt in particular).

Note that the project home has moved to GitHub: https://github.com/Microsoft/ptvs. If you have any further questions, please ask them there, as we'll stop monitoring these forums soon.
May 18, 2015 at 4:37 AM
Thanks for the reply. I've got Python running in VS but I can't seem to figure out how to get PyQt loaded into VS. Can you point me in the right direction?
Coordinator
May 18, 2015 at 4:48 AM
Install Anaconda, and use it instead of the Python that you currently have: https://store.continuum.io/cshop/anaconda/
May 18, 2015 at 5:50 AM
Installed Anaconda, updated VS to point to Anaconda but VS still can't find PyQt4.QtGui. Any idea on what I'm doing wrong?
Coordinator
May 18, 2015 at 6:29 AM
Try running it. If it actually works when it's run, and you only see the error in the editor, it's most likely because the completion database for Anaconda hasn't been refreshed yet. You can refresh it as described here: https://github.com/Microsoft/ptvs/wiki/Editor-Features#intellisense. If you're using PTVS 2.2 RC (you should!), the UI has changed there, so take a look at this video instead: https://www.youtube.com/watch?v=KY1GEOo3qy0.

If you're still having issues, can you please create a discussion item on GitHub for further questions? As noted earlier, we're moving away from CodePlex, and all new discussions should be over on GH.