Skip to content

platforms

Anthony Sottile edited this page Mar 23, 2020 · 9 revisions

script

# -c '
import os
import platform
import sys
import sysconfig

class NA(object):
    def __repr__(self):
        return "<<not available>>"

def peval(s):
    try:
        r = eval(s)
    except AttributeError:
        r = NA()
    print("- **`{}`**: `{!r}`".format(s, r))


peval("sys.version")
peval("os.name")
peval("sys.platform")
peval("platform.system()")
peval("platform.python_implementation()")
peval("sys.implementation.name")
peval("sysconfig.get_platform()")
# '

linux ubuntu

cpython 2.x

  • sys.version: '2.7.15rc1 (default, Nov 12 2018, 14:31:15) \n[GCC 7.3.0]'
  • os.name: 'posix'
  • sys.platform: 'linux2'
  • platform.system(): 'Linux'
  • platform.python_implementation(): 'CPython'
  • sys.implementation.name: <<not available>>
  • sysconfig.get_platform(): 'linux-x86_64'

cpython 3.x

  • sys.version: '3.6.7 (default, Oct 22 2018, 11:32:17) \n[GCC 8.2.0]'
  • os.name: 'posix'
  • sys.platform: 'linux'
  • platform.system(): 'Linux'
  • platform.python_implementation(): 'CPython'
  • sys.implementation.name: 'cpython'
  • sysconfig.get_platform(): 'linux-x86_64'

pypy 2.x

  • sys.version: '2.7.13 (8cdda8b8cdb8, Apr 14 2019, 14:06:44)\n[PyPy 7.1.1 with GCC 6.2.0 20160901]'
  • os.name: 'posix'
  • sys.platform: 'linux2'
  • platform.system(): 'Linux'
  • platform.python_implementation(): 'PyPy'
  • sys.implementation.name: <<not available>>
  • sysconfig.get_platform(): 'linux-x86_64'

pypy 3.x

  • sys.version: '3.6.1 (784b254d6699, Apr 14 2019, 10:22:42)\n[PyPy 7.1.1-beta0 with GCC 6.2.0 20160901]'
  • os.name: 'posix'
  • sys.platform: 'linux'
  • platform.system(): 'Linux'
  • platform.python_implementation(): 'PyPy'
  • sys.implementation.name: 'pypy'
  • sysconfig.get_platform(): 'linux-x86_64'

macos mojave

cpython 2.x

  • sys.version: '2.7.10 (default, Feb 22 2019, 21:17:52) \n[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14)]'
  • os.name: 'posix'
  • sys.platform: 'darwin'
  • platform.system(): 'Darwin'
  • platform.python_implementation(): 'CPython'
  • sys.implementation.name: <<not available>>
  • sysconfig.get_platform(): 'macosx-10.14-intel'

cpython 3.x

  • sys.version: '3.7.3 (default, Mar 27 2019, 09:23:15) \n[Clang 10.0.1 (clang-1001.0.46.3)]'
  • os.name: 'posix'
  • sys.platform: 'darwin'
  • platform.system(): 'Darwin'
  • platform.python_implementation(): 'CPython'
  • sys.implementation.name: 'cpython'
  • sysconfig.get_platform(): 'macosx-10.14-x86_64'

windows 10

cpython 2.x (64 bit)

  • sys.version: '2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)]'
  • os.name: 'nt'
  • sys.platform: 'win32'
  • platform.system(): 'Windows'
  • platform.python_implementation(): 'CPython'
  • sys.implementation.name: <<not available>>
  • sysconfig.get_platform(): 'win-amd64'

cpython 3.x (64 bit)

  • sys.version: '3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)]'
  • os.name: 'nt'
  • sys.platform: 'win32'
  • platform.system(): 'Windows'
  • platform.python_implementation(): 'CPython'
  • sys.implementation.name: 'cpython'
  • sysconfig.get_platform(): 'win-amd64'

cygwin cpython 2.x (64 bit)

  • sys.version: '2.7.13 (default, Mar 13 2017, 20:56:15) \n[GCC 5.4.0]'
  • os.name: 'posix'
  • sys.platform: 'cygwin'
  • platform.system(): 'CYGWIN_NT-10.0'
  • platform.python_implementation(): 'CPython'
  • sys.implementation.name: <<not available>>
  • sysconfig.get_platform(): 'cygwin-2.8.2-x86_64'

cygwin cpython 3.x (64 bit)

  • sys.version: '3.6.1 (default, Mar 21 2017, 21:49:16) \n[GCC 5.4.0]'
  • os.name: 'posix'
  • sys.platform: 'cygwin'
  • platform.system(): 'CYGWIN_NT-10.0'
  • platform.python_implementation(): 'CPython'
  • sys.implementation.name: 'cpython'
  • sysconfig.get_platform(): 'cygwin-2.8.2-x86_64'

msys2 (msys) cpython 2.x (64 bit)

via pacman -Sy python2

  • sys.version: '2.7.16 (default, Apr 25 2019, 07:03:32) \n[GCC 7.4.0]'
  • os.name: 'posix'
  • sys.platform: 'msys'
  • platform.system(): 'MSYS_NT-10.0-17134'
  • platform.python_implementation(): 'CPython'
  • sys.implementation.name: <<not available>>
  • sysconfig.get_platform(): 'msys-3.0.7-x86_64'

msys2 (msys) cpython 3.x (64 bit)

via pacman -Sy python3

  • sys.version: '3.7.3 (default, Apr 25 2019, 06:50:16) \n[GCC 7.4.0]'
  • os.name: 'posix'
  • sys.platform: 'msys'
  • platform.system(): 'MSYS_NT-10.0-17134'
  • platform.python_implementation(): 'CPython'
  • sys.implementation.name: 'cpython'
  • sysconfig.get_platform(): 'msys-3.0.7-x86_64'

msys2 (mingw64) cpython 2.x (64 bit)

via pacman -Sy mingw-w64-x86_64-python2

  • sys.version: '2.7.16 (default, May 28 2019, 08:10:12) [GCC 8.3.0 64 bit (AMD64)]'
  • os.name: 'nt'
  • sys.platform: 'win32'
  • platform.system(): 'Windows'
  • platform.python_implementation(): 'CPython'
  • sys.implementation.name: <<not available>>
  • sysconfig.get_platform(): 'mingw'

msys2 (mingw64) cpython 3.x (64 bit)

via pacman -Sy mingw-w64-x86_64-python3

  • sys.version: '3.7.3 (default, May 28 2019, 08:37:07) [GCC 8.3.0 64 bit (AMD64)]'
  • os.name: 'nt'
  • sys.platform: 'win32'
  • platform.system(): 'Windows'
  • platform.python_implementation(): 'CPython'
  • sys.implementation.name: 'cpython'
  • sysconfig.get_platform(): 'mingw'