python模块dll [英] python module dlls

查看:182
本文介绍了python模块dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以使python模块将dll加载到我的应用程序目录中,而不是python安装随附的版本中,而无需更改python安装(这将要求我进行安装,请谨慎操作)我没有通过覆盖python模块并全局更改dll版本来破坏其他应用程序吗?)?

Is there a way to make a python module load a dll in my application directory rather than the version that came with the python installation, without making changes to the python installation (which would then require I made an installer, and be careful I didn't break other apps for people by overwrting python modules and changing dll versions globaly...)?

具体来说,我希望python使用我的sqlite3.dll版本,而不是python随附的版本(该版本较旧,并且似乎没有fts3模块).

Specifically I would like python to use my version of the sqlite3.dll, rather than the version that came with python (which is older and doesn't appear to have the fts3 module).

推荐答案

好吧,不管python和os路径设置为什么,python总是将dll与pyd文件放在同一目录中.

Ok it terns out python always loads the dll in the same directory as the pyd file, regardless of what the python and os paths are set to.

因此,我需要将_sqlite3.pyd从python/v2.5/DLLS复制到新的sqlite3.dll所在的我的apps目录中,以使其加载我的新dll,而不是python随附的dll(因为pyd文件似乎遵循PYTHONPATH,即使actaul dll本身没有).

So I needed to copy the _sqlite3.pyd from python/v2.5/DLLS to my apps directory where the new sqlite3.dll is, making it load my new dll, rather than the one that comes with python (since the pyd files seem to follow the PYTHONPATH, even though the actaul dlls themselves dont).

这篇关于python模块dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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