Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #78899
| From | Gelonida N <gelonida@gmail.com> |
|---|---|
| Subject | Re: virtualenv question: include just a few site packages |
| Date | 2014-10-09 17:55 +0200 |
| References | <m14cnh$2hv$1@ger.gmane.org> <515407053.9531235.1412860769774.JavaMail.root@sequans.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.14719.1412870165.18130.python-list@python.org> (permalink) |
On 10/09/2014 03:19 PM, Jean-Michel Pichavant wrote: > ----- Original Message ----- >> virtualenv has the switch >> --system-site-packages (including all system site pacgaes) >> and the switch >> --no-site-packages (to expclude all site packages) >> >> Does anyone know an easy way to include just a few site-packages? >> for example (PySide, but not PyQt) >> >> The reason I'm asking is following. >> Some site packages are sometimes raher huge or sometimes refuse to >> compile on certain hosts. >> >> as these packages are already part of the site packages I'd like to >> include them. >> >> You might wonder why I care whether I have more site packages than I >> need. As long as I don't import them, I shouldn't care about it. >> If I really wanted to replace a version I could use pip install -U. >> >> However sometimes I'd like to have a test environment where want to >> be >> sure, that no module can find certain other modules. so they should >> not be visible. >> >> at the moment I make some experiments with pyinstaller and the module >> pythonqtbindings. and there I'd like to be sure that no PuQt files >> end up in the generated code. >> >> The only idea, that I have so far is to >> run virutalanv with --system-side-packages and to manually remove >> modules I don't want or to >> run virtualenv without this switch and to manually add links for site >> packages, taht I want. both options don't really feel right for me. >> >> Is there any other way? > > You could build a virtual machine, installing only your VIP modules, and create virtual environment on this virtual machine, using the system site packages. > Yeah that's an option. However I guess in this case it's probably faster to write a script, that 'post-processes' the virtualenv and just deletes files / symlinks, that are not desired. Definitely not elegant, but probably OK. On the other hand a VM migfht help finding out which files to keep.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: virtualenv question: include just a few site packages Gelonida N <gelonida@gmail.com> - 2014-10-09 17:55 +0200
csiph-web