Python 在 Windows 8.1 64 位上错误地检测到 32 位系统 [英] Python incorrectly detects 32-bit system on Windows 8.1 64-bit

查看:31
本文介绍了Python 在 Windows 8.1 64 位上错误地检测到 32 位系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<前>PS C:\Users\************> C:\Python27\python.exePython 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 位 (AMD64)] 在 win32 上输入帮助"、版权"、信用"或许可"以获取更多信息.>>> 进口平台>>> 平台.架构()('64bit', 'WindowsPE')

注意on win32"部分(在[MSC v.1500 64 bit (AMD64)] on win32"中).

"This PC" -> Properties 也显示 windows 是 64 位的.当我尝试安装不同的 Python3 版本时也是如此.

为什么按钮无法正确检测 32 位操作系统?这可以防止仅在 64 位上工作的模块工作.

更新:阅读https://groups.google.com/forum/#!topic/glazier-discuss/Gyrm2IsNhDA - Windows PE 可能会导致问题.

解决方案

win32 并不一定意味着你的 windows 是 32bit 系统,它意味着你在 windows 上操作系统,它只是由于历史原因留在那里.而你This PC上的属性足以确认它是64位窗口.顺便说一句,没有 win64.

您要找的线路是这样的,
[MSC v.1500 64 位 (AMD64)] - 这意味着它是用 MSVC 编译器构建的 64 位

为了更可靠地检查您的解释器是作为 32 位还是 64 位运行,试试这个,

导入系统print(sys.maxsize > 2**32) # 64 位必须返回 TRUE

PS C:\Users\************> C:\Python27\python.exe
Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.architecture()
('64bit', 'WindowsPE')

Notice the "on win32" part (in "[MSC v.1500 64 bit (AMD64)] on win32").

"This PC" -> Properties also shows that windows is 64-bit. Same when I tried installing different Python3 versions.

Why does button detects OS 32-bit incorrectly? This prevents modules that only work on 64-bit from working.

Upd: reading https://groups.google.com/forum/#!topic/glazier-discuss/Gyrm2IsNhDA - Windows PE might cause problems.

解决方案

win32 doesn't necessarily mean your windows is a 32bit system, It means you are on windows operating system, And it is just left there for historical reasons. And the properties on your This PC are enough to confirm it is 64bit windows. There is no win64 btw.

The line you are looking for is this,
[MSC v.1500 64 bit (AMD64)] - Meaning it was built with MSVC compiler for 64-bit

and to more reliably check for if your interpreter is running as 32bit or 64bit try this,

import sys
print(sys.maxsize > 2**32) # must return TRUE for 64bit

这篇关于Python 在 Windows 8.1 64 位上错误地检测到 32 位系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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