Forum Archive

`import sysconfig; sysconfig.get_platform()` produces traceback ...

georg.viehoever

instead of producing something like 'iOS'.
Georg

JonB

on my device i get

>>> sysconfig.get_platform()
'darwin-14.0.0-iPad3,3'

this is on the beta, but pretty sure i used this on 1.5 as well. what traceback do you yet?

ccc

Mine throws ImportError: No module named _osx_support but platform.platform() returns 'Darwin-14.0.0-iPad3,4-32bit'.

georg.viehoever

I get the import error described by @ccc, Latest Beta, ipad 2 (without air), ios8 .

Phuket2

I also get the same import error as @ccc. But I get a different result for platform.platform()
I get:
Darwin-14.0.0-iPad5,4-64bit

Pythonista 1.6, iPad Air 2, iOS 8.4.1

Olaf

same error here on Pyhonista 1.5 (non-beta).
The source of sysconfig.get_platform ends:

elif osname[:6] == "darwin":
        import _osx_support
        osname, release, machine = _osx_support.get_platform_osx(
                                            get_config_vars(),
                                            osname, release, machine)

    return "%s-%s-%s" % (osname, release, machine)

What is it on 1.6?

georg.viehoever

Ipad2, iOS 8.4.1, Pythonista1.6 Beta:

>>> import sysconfig
>>> sysconfig.get_platform()
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/mobile/Containers/Bundle/Application/22209BDA-9306-47FF-9078-F00CD4EA7E10/Pythonista.app/pylib/sysconfig.py", line 603, in get_platform
    import _osx_support
ImportError: No module named _osx_support
>>> import platform
>>> platform.platform()
'Darwin-14.0.0-iPad2,1-32bit'

@Olaf : Same code in 1.6 Beta

JonB

ahhh, thats because i have a faked _os_x_support.py. as a workaround, place the following somewhere on the path, like in site-packages:

def get_platform_osx(cvar,osname,release,machine):
   return osname,release,machine