编程语言
首页 > 编程语言> > Python:如何为64位python导入32位模块

Python:如何为64位python导入32位模块

作者:互联网

由于系统限制,我只能使用64位版本的Python,但是我打算使用的一些模块不带64位版本(例如httplib2).在这种情况下,我应该怎么做以利用这些32位功能?

感谢j_mcnally的回答.这样可行.最终适用于我的另一种方法是,如果安装了python的多版本(例如32/64),则使用prefix参数:

python setup.py install –prefix = “your python root directory”

解决方法:

请原谅我的无知,但你不能把它们编译成64位模块吗?

http://code.google.com/p/httplib2/

来源就在那里.我想成像最现代的./configure脚本将检测你的arch,并编译适当的扩展.

以下似乎对我有用:

ARCHFLAGS =’ – arch x86_64’python setup.py install

running install running bdist_egg running egg_info writing

python2/httplib2.egg-info/PKG-INFO writing top-level names to

python2/httplib2.egg-info/top_level.txt writing dependency_links to

python2/httplib2.egg-info/dependency_links.txt reading manifest file

‘python2/httplib2.egg-info/SOURCES.txt’ reading manifest template

‘MANIFEST.in’ writing manifest file

‘python2/httplib2.egg-info/SOURCES.txt’ installing library code to

build/bdist.macosx-10.8-x86_64/egg running install_lib running

build_py creating build creating build/lib creating build/lib/httplib2

copying python2/httplib2/init.py -> build/lib/httplib2 copying

python2/httplib2/iri2uri.py -> build/lib/httplib2 copying

python2/httplib2/socks.py -> build/lib/httplib2 copying

python2/httplib2/cacerts.txt -> build/lib/httplib2 creating

build/bdist.macosx-10.8-x86_64 creating

build/bdist.macosx-10.8-x86_64/egg creating

标签:32bit-64bit,python,import
来源: https://codeday.me/bug/20190826/1726110.html