Win32 Support

0 views
Skip to first unread message

Michael Pearce

unread,
Nov 10, 2009, 6:41:00 AM11/10/09
to turbo...@googlegroups.com
I'm having problems installing the win32com functions for my TG2 application. When I try to run the binary (pywin32) from within the virtual environment (tg2env) it seems to add the module to the python26 site-packages directory, and not the virtual environment directory. As a result, I'm unable see the win32com functions from my turbogears application. Is there some way to easy_install pywin32 instead of running the binary?

Rgds,
Michael

Diez B. Roggisch

unread,
Nov 10, 2009, 7:07:03 AM11/10/09
to turbo...@googlegroups.com
Michael Pearce schrieb:

This is a problem of the suggestion to use --no-site-packages. I never
understood why it's given in the first place.

If you create the VE without that option, you can import win32 without a
hitch.

Of course, you need to make sure that none of the TG2-packages and it's
dependencies is already in the system python's path.

Diez

Christopher Arndt

unread,
Nov 10, 2009, 9:44:29 AM11/10/09
to turbo...@googlegroups.com
Diez B. Roggisch wrote:
> This is a problem of the suggestion to use --no-site-packages.

It's not a problem, it's exactly the purpose of this option: hide
modules/packages installed in the system-wide site-packages directory
from the python path.

> I never understood why it's given in the first place.

Because nowadays many Linux distros come with some of TG's dependencies
installed as system packages, but with too old versions. easy_install
and friends do not always update them reliably when you install TG.

If you use the --no-site-packages option, up-to-date versions of these
packages will be installed in the virtualenv no matter what.

> Of course, you need to make sure that none of the TG2-packages and
> it's dependencies is already in the system python's path.

There you have it.


Chris

Kevin Horn

unread,
Nov 10, 2009, 11:23:02 AM11/10/09
to turbo...@googlegroups.com

Diez B. Roggisch

unread,
Nov 10, 2009, 11:52:19 AM11/10/09
to turbo...@googlegroups.com
Christopher Arndt schrieb:

> Diez B. Roggisch wrote:
>> This is a problem of the suggestion to use --no-site-packages.
>
> It's not a problem, it's exactly the purpose of this option: hide
> modules/packages installed in the system-wide site-packages directory
> from the python path.
>
> > I never understood why it's given in the first place.
>
> Because nowadays many Linux distros come with some of TG's dependencies
> installed as system packages, but with too old versions. easy_install
> and friends do not always update them reliably when you install TG.

True. I should have worded that differently: the instructions simply
mention it, without explaining the Consequences.

http://turbogears.org/2.0/docs/main/DownloadInstall.html

There is some discussion on the bottom about this - but who's reading
that, especially if everything is working?

Diez

Reply all
Reply to author
Forward
0 new messages