为什么 Python 2.7 AMD 64 安装程序似乎在 32 位模式下运行 Python? [英] Why does the Python 2.7 AMD 64 installer seem to run Python in 32 bit mode?
问题描述
我已经从 python.org 的 python-2.7.amd64.msi 包安装了 Python 2.7.它可以正确安装和运行,但似乎处于 32 位模式,尽管安装程序是 64 位安装程序.
I've installed Python 2.7 from the python-2.7.amd64.msi package from python.org. It installs and runs correctly, but seems to be in 32-bit mode, despite the fact that the installer was a 64 bit installer.
Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys, platform
>>> platform.architecture()
('64bit', 'WindowsPE')
>>> sys.maxint
2147483647
我该怎么做才能安装 Python 使其真正在 64 位模式下运行?
What can I do to install Python so that it actually runs in 64-bit mode?
推荐答案
查看讨论 此处.它来自 2.6.1,但似乎仍然适用.至少,我在任何地方都没有看到相反的证据.事情的要点(引自该链接)是:
See the discussion here. It's from 2.6.1, but it seems to still apply. I haven't seen evidence to the contrary anywhere, at least. The gist of the matter (quoted from that link) is:
这是设计使然.在他们的不定式智慧中,微软决定使long"C 类型始终为 32 位有符号整数 - 即使在 64 位上系统.在大多数 Unix 系统上,long 至少为 32 位,但通常大小(ptr).
This is by design. In their infinitive wisdom Microsoft has decided to make the 'long' C type always a 32 bit signed integer - even on 64bit systems. On most Unix systems a long is at least 32 bit but usually sizeof(ptr).
这篇关于为什么 Python 2.7 AMD 64 安装程序似乎在 32 位模式下运行 Python?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!