Open python console:
import platform
platform.architecture()[0]
it should display the '64bit' or '32bit' according to your platform.
Alternatively( in case of OS X binaries ):
import sys
sys.maxsize > 2**32
# it should display True in case of 64bit and False in case of 32bit
测试结果如下:
$ python3
Python 3.7.1 (default, Nov 28 2018, 11:51:47)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.architecture()[0]
'64bit'
>>> import sys
>>> sys.maxsize > 2**32
True
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>> exit() # exit python console
(venv)
$ pyenv install 3.6.5
python-build: use openssl from homebrew
python-build: use readline from homebrew
Downloading Python-3.6.5.tar.xz...
-> https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz
Installing Python-3.6.5...
python-build: use readline from homebrew
Installed Python-3.6.5 to /Users/wangbingfeng/.pyenv/versions/3.6.5
参考地址: