views:

341

answers:

1

Hi i'm using virtualenv with profit on my develop environment with web.py, simplejson and other web oriented packages. I'm preparing to develop a simple python client using Qt to reuse some Api developed with web.py. Does anybody here had succesfully installed PyQt4 with virtualenv? Is it possible? I've downloaded all the binaries and have PyQt4 installed globally on my python2.6 directory. If i don't use --no-site--packages option, virtualenv correctly include PyQt4 in my new sandbox but, obviously, with all global packages that i don't need. Is there a clean way to prepare a new sandbox with --no-site--packages option and then add PyQt4 or PySide using pip, easy_install or some magic trick?

thanks in advance and Merry Christmas

+1  A: 

It should be enough to create an empty virtualenv and then copy the contents of the .../site-packages/PyQt4 directories into it.

I suggest to install PyQt4 once globally, make a copy of the directory, uninstall it and then use this trick to create VEs.

Aaron Digulla
Thanks for your help.Copying the directory i can import PyQt4 from command line without error but i'm missing sip (ImportError: No module named sip).Do i need to copy that too?Do you think pyuic4 will work?
systempuntoout
Yes, that should fix it. I missed sip because it's in site-packages (no subdirectory). As for pyuic4, it should work.
Aaron Digulla
I copied sip.so inside site-packages under sandbox python directory and it worked.
systempuntoout