如何在无需包含主机环境的 site-packages 文件夹的情况下将 pywin32 与 virtualenv 一起使用? [英] How can I use pywin32 with a virtualenv without having to include the host environment's site-packages folder?

查看:38
本文介绍了如何在无需包含主机环境的 site-packages 文件夹的情况下将 pywin32 与 virtualenv 一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Python 2.6 下使用 PyInstaller,由于 MS 造成的混乱,仅部分支持它们的清单废话现在影响了 Python,因为它现在是 MSVC8 编译的.

I'm working with PyInstaller under Python 2.6, which is only partially supported due to the mess MS have created with their manifest nonense which now affects Python since it is now MSVC8 compiled.

问题在于清单嵌入支持依赖于 pywin32 扩展以便构建这很痛苦,因为在创建 virtualenv(在构建环境中有点失败)我找不到安装所需扩展的方法,以便 PyInstaller 可以访问它们.

The problem is that the manifest embedding support relies on the pywin32 extensions in order to build which is a pain because without including the host's site-packages folder when I create the virtualenv (kinda defeats the point in a build environment) I cannot find a way to install the required extensions so they are accessible to PyInstaller.

有没有人找到解决这个问题的方法?

Has anyone found a solution to this issue?

推荐答案

好的,因为我必须找到前进的道路,所以我即兴创作.我在内部创建了一个 git 存储库,其中包含一个 pywin32 的 hacked-together 版本,它将使用标准的 setup.py 脚本安装在 virtualenv 中.花了很多时间才能让它正常工作,但我设法让它加载,并且依赖代码现在可以按照我的需要工作.如果人们觉得这对社区有益,请发表评论:如果我受够了,我会尝试在我的 github 帐户上放一些东西.

OK, well since I had to find a way forward I improvised. I've internally created a git repository with a hacked-together version of pywin32 that will install within a virtualenv using the standard setup.py script. It took a lot of fiddling to make it work right but I managed to get it to load and the dependent code now works as I need it to. If people feel this would be of benefit to the community please post a comment: if I get enough I'll try and put something up on my github account.

这篇关于如何在无需包含主机环境的 site-packages 文件夹的情况下将 pywin32 与 virtualenv 一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆