On Fri, Feb 27, 2009 at 3:11 PM, yvesm <[email protected]> wrote: > > Disclaimer I'm not a windows user but.....
>> Hi, the problem is the --no-site-packages that makes the venv 100% >> isolated which means global packages (mysqldb, win32api, etc.) won't >> be loaded. It's something you normally learn over time but it has come >> up so many times that I think I'm going to add it to the install docs. > > I see now. I thought the "generating Python" would carry the win32all > functionnality over to the venv, site-packages carried over or not. > So do I understand that the virtualenv command 1) generates a new > Python interpreter which it shoves into the venv and then 2) calls > that new interpreter to build whatever else the venv needs ? > actually no, venvs predecessor used a copy that turned out to be a bad idea. it simply uses a modification of PATH. news flash win32api is installed inside your site-packages :) >> You have 2 options >> >> 1- install win32api inside the venv (I'm not sure this works, some >> complex packages with C dependencies just don't work, not to mention >> you may need a compiler for it) > > I'm building an NSIS installer part of which creates venvs. It's > already hard enough for me to send commands to the system fomr my NSIS > script ;-) > Have you taken a look at Sanjiv's installer work, also Florent has a project called pylunch. I believe the first solves your issue and the second will help you build the py2exe part of the platform. >> 2- do not use the --no-site-packages flag which will expose the >> win32api and everything else from your global site-packages to the >> venv, which means you need to be careful with the content of the >> global one or you could screw up your install.. > > I could live with carrying over my system Python site-packages because > I did not intend it to be loaded with tons of packages. I expected > the Python in my venvs would extend the system Python with their own > site-packages, so for example I could set up TG2 and some other Pylons > app that requires different versions of SQLAlchemy for example. > then you need to skip the flag and make sure your system python is clean (even ON deployment machines) the potential pitfall here is that if for example a end user has an application using SQLAlchemy 0.3 and you install your TG2 app it will try to use the 0.3 which is most likely going to give you troubles. > But it turns out running the virtualenv command with or without the -- > no-site-packages option does not solve the problem : the virtualenv > command still cannot instantiate a venv correctly in an arbitrary > windows location. The only difference is that my venv Python path is > different : > > without --no-site-packages > yes this is correct behavior >>>> sys.path > > ['', > 'C:\\WINDOWS\\system32\\python25.zip', > 'C:\\Program Files\\MyDir\\TileCache\\DLLs', > 'C:\\Program Files\\MyDir\\TileCache\\lib', > 'C:\\Program Files\\MyDir\\TileCache\\lib\\plat-win', > 'C:\\Program Files\\MyDir\\TileCache\\lib\\lib-tk', > 'C:\\Program Files\\MyDir\\TileCache\\Scripts', > 'C:\\Program Files\\MyDir\\Python25\\Lib', > 'C:\\Program Files\\MyDir\\Python25\\DLLs', > 'C:\\Program Files\\MyDir\\Python25\\Lib\\lib-tk', > 'C:\\Program Files\\MyDir\\TileCache', > 'C:\\Program Files\\MyDir\\TileCache\\lib\\site-packages', > 'C:\\Program Files\\MyDir\\Python25', > 'C:\\Program Files\\MyDir\\Python25\\lib\\site-packages', > 'C:\\Program Files\\MyDir\\Python25\\lib\\site-packages\\win32', > 'C:\\Program Files\\MyDir\\Python25\\lib\\site-packages\\win32\\lib', > 'C:\\Program Files\\MyDir\\Python25\\lib\\site-packages\\Pythonwin'] > > with --no-site-packages > >>>> sys.path > > ['', > 'C:\\WINDOWS\\system32\\python25.zip', > 'C:\\Program Files\\MyDir\\TileCache\\DLLs', > 'C:\\Program Files\\MyDir\\TileCache\\lib', > 'C:\\Program Files\\MyDir\\TileCache\\lib\\plat-win', > 'C:\\Program Files\\MyDir\\TileCache\\lib\\lib-tk', > 'C:\\Program Files\\MyDir\\TileCache\\Scripts', > 'C:\\Program Files\\MyDir\\Python25\\Lib', > 'C:\\Program Files\\MyDir\\Python25\\DLLs', > 'C:\\Program Files\\MyDir\\Python25\\Lib\\lib-tk', > 'C:\\Program Files\\MyDir\\TileCache', > 'C:\\Program Files\\MyDir\\TileCache\\lib\\site-packages'] > > So I do get an access to my system Python site-packages without the -- > no-site-packages flag, which is to be expected, but the virtualenv > command still crashes. > >> 3- patch venv to add the --some-site-packages flag, this is something >> that has been discussed yet no one has come up with patches. > > AFAICT, this won't solve the issue of virtualenv not being able to > instantiate at an arbitrary location on a windows system, the most > likely location being "C:\Program Files" ... > > Thanx for your help, > > Yves > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

