简体   繁体   English

32位模块如何在64位Python上运行?

[英]How can 32bit modules run on 64bit Python?

I wrote a genetic algorithm program using the inspyred library with a 32bit Python2.7 version on a 64bit Win7 machine. 我在64位Win7机器上使用带有32位Python2.7版本的inspyred库编写了一个遗传算法程序。 While generating the population the program stops running when it uses memory up to 1959044K. 在生成总体时,程序在使用高达1959044K的内存时停止运行。

I have read a number of questions on this site, and I understand that it is due to a 2GB cap on 32bit programs by the OS. 我在这个网站上已经阅读了很多问题,据我所知,这是因为操作系统对32位程序的上限为2GB。 So I have tried to switch to a 64bit Python and install the 64bit versions of the modules I was working with, unfortunately all but one module cannot run on the 64bit platform. 所以我试图切换到64位Python并安装我正在使用的64位版本的模块,遗憾的是除了一个模块之外,所有模块都无法在64位平台上运行。

I also installed pywin32 as advised in another question but that has failed to help too. 我还在另一个问题中按照建议安装了pywin32但是也没有帮助。 This module is not a standard Python library and I have pasted it below. 这个模块不是标准的Python库,我在下面粘贴了它。 The error message I get is: 我得到的错误信息是:

import AoN
ImportError: DLL load failed: %1 is not a valid Win32 application.

My understanding is that the 64bit Python does not recognize the 32bit module. 我的理解是64位Python无法识别32位模块。 I also read here: http://effbot.org/zone/python-compile.htm about compiling the source code, but I have compiled the source code in 64bit but that does not help either as it continues to give that error. 我也在这里阅读: http//effbot.org/zone/python-compile.htm关于编译源代码,但是我已经编译了64位的源代码,但这并没有帮助,因为它继续给出错误。

Lastly I pasted the directory path of the module in the interpreter path but that does not help too. 最后,我在解释器路径中粘贴了模块的目录路径,但这也没有用。

Is there a way to have this module run on the 64bit Python? 有没有办法让这个模块在64位Python上运行? And please can anyone explain the process of compiling source codes and if that can help me out? 请任何人解释编译源代码的过程,如果这可以帮助我?

The answer is simple - it can't work. 答案很简单 - 它不起作用。 A process is either 32 or 64 bit, it's as simple as that. 进程是32位或64位,就这么简单。 So if there is one module that can't run in 64 bit, one option besides re-compiling the module for 64 bit is to delegate whatever purpose it has to a second process running in 32 bit, just doing that. 因此,如果有一个模块不能以64位运行,除了重新编译64位模块之外,还有一个选项是将它具有的任何目的委托给以32位运行的第二个进程,就这样做。 This might or might not be practical, depending on the actual task of the module. 这可能是也可能不实用,具体取决于模块的实际任务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM