gpt4 book ai didi

Windows 7 上的 python x86-64 安装程序

转载 作者:太空宇宙 更新时间:2023-11-04 06:20:47 25 4
gpt4 key购买 nike

我正在尝试在 Windows 7 64 位虚拟机上安装 64 位版本的 python。我从 here 获得了 Python 2.7.3 Windows X86-64 安装程序.安装直接进行,但是当我启动 python 时,我得到:

Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win 32

如果我尝试:

import sys
sys.maxint
2147483647

这并不是我对 64 位 python 的真正期望,并且与我从我的 fedora 64 位安装中获得的不同:

9223372036854775807

有什么想法吗?

问候,博格丹

最佳答案

这是因为Windows 64-bit ABI is different from Linux .

Python 实现使用 C long 类型作为 Python int 类型,而 C long 在 64 位 Windows 上仍然只有 32 位宽.

请参阅 Python 中的 intobject.h:

typedef struct {
PyObject_HEAD
long ob_ival;
} PyIntObject;

关于Windows 7 上的 python x86-64 安装程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12455365/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com