New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
virtualenv cannot handle pythonXY.zip
? (entire stdlib in zipfile)
#422
Comments
My first thought is that I can't imagine this ever working (or being supported) for virtualenv. The codebase is built entirely around copying files from the base install, and short using of a "virtual filesystem" style of library, ewe're not going to be able to write the code so that it transparently handles extracting files from zipfiles the same way. The best I can think of is that we should put a note in the documentation saying that we explicitly don't support this configuration. I know that's no help to you, sorry :-( |
no worries... i actually think i got it working rather "painlessly"... BEHOLD! :) TL;DR
SPECIFICS...from within unzip ../python27.zip 'site.*' 'opcode.*' 'distutils**'
zip -d ../python27.zip 'site.*' 'opcode.*' 'distutils**' ...which extracts, then removes, specific modules from the zipfile that virtualenv uses to get it's bearings... unfortunately there does not appear to be a way around removing stuff from the zipfile because it holds higher precedence than the loose files (for good reason)... but ....that's pretty much it, but to be pedantic, i also symlinked config/lib-dynload/os.py/python27.zip/include, copied python2.7, copied activate(changed path)/site.py/distutils from another venv, created orig-prefix.txt and no-global-site-packages.txt, and finally... installed distribute + pip (distribute_setup.py + get-pip.py) after sourcing the activate script. ...at this point sys.*prefix properly referenced the venv, and as further proof, i successfully not sure if you guys think it's too much, but tbh, i started with a working venv, and tweaked only a small number of things to make it work properly. is there anything else needed to confirm proper function? from within the venv, i get this:
NOTES
|
Thanks for the analysis. I don't know if we can fix the zip vs loose file priority issue, but I'll see if I can get some time to look into this (no promises, I'm afraid, but of course "patches welcome" :-)) This might be good to write up as a cookbook-style entry for the virtualenv docs. Again, I'll try to get to that, but it'd need to cover Python 3 as well, to be complete, which means I'll need to do some testing. Leaving the report open as a reminder to myself (or anyone else who's interested!) that this could do with writing up. Many thanks for working this through and reporting back. |
cool, np... in related news, i just noticed a STANDARD python install DOES NOT favor the zipfile (which, i guess, makes sense... flexibility at some [probably negligible] import-time expense):
...thus is must be virtualenv's site.py mucking that part up? haven't checked it out, but seems likely. |
FYI: I'm also facing the situation with python embedded within softwares like maya, nuke, etc.. they effectively bundle a python where python27 directory is zipped the way as @anthonyrisinger reports. it doesn't seem there had progress on this issue since then ? may I eventually help ? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions. |
This issue still exists. Please help |
This requires a new implementation, which may be possible after the rewrite. |
our base python install zips the entire stdlib (except
config
,site-packages
, andlib-dynload
) for space and performance (84MiB => 28MiB, similar load speed gains)......however, virtualenv doesn't seem to like this at all:
next, i tried unzipping only site., which didn't work, because
python27.zip
is _PREFERRED. so, i removed site._ frompython27.zip
and tried again:...no dice? i tried with[out]
--system-site-packages
and same result. zipping the stdlib is probably not common, but it's an explicitly known and expected use case... how can i make this work?The text was updated successfully, but these errors were encountered: