pact-python icon indicating copy to clipboard operation
pact-python copied to clipboard

Exception: macOS-10.14.6-x86_64-i386-64bit is not a supported platform

Open avanov opened this issue 6 years ago • 1 comments

Hi! I'm getting the following error when trying to pip install pact-python from within a nix shell on OSX:

    Running setup.py install for pact-python ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/maksim.avanov/myproject/.venv/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/jc/lkx1_cd52zlbqp9b5574_bjr5kfbm5/T/pip-install-z7ite8wo/pact-python/setup.py'"'"'; __file__='"'"'/private/var/folders/jc/lkx1_cd52zlbqp9b5574_bjr5kfbm5/T/pip-install-z7ite8wo/pact-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/jc/lkx1_cd52zlbqp9b5574_bjr5kfbm5/T/pip-record-fk8g3_51/install-record.txt --single-version-externally-managed --compile --install-headers /Users/maksim.avanov/myproject/.venv/include/site/python3.8/pact-python
         cwd: /private/var/folders/jc/lkx1_cd52zlbqp9b5574_bjr5kfbm5/T/pip-install-z7ite8wo/pact-python/
    Complete output (66 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib
    creating build/lib/pact
    copying pact/provider.py -> build/lib/pact
    copying pact/constants.py -> build/lib/pact
    copying pact/__init__.py -> build/lib/pact
    copying pact/__version__.py -> build/lib/pact
    copying pact/consumer.py -> build/lib/pact
    copying pact/matchers.py -> build/lib/pact
    copying pact/verify.py -> build/lib/pact
    copying pact/pact.py -> build/lib/pact
    running install_lib
    creating /Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/pact
    copying build/lib/pact/provider.py -> /Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/pact
    copying build/lib/pact/constants.py -> /Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/pact
    copying build/lib/pact/__init__.py -> /Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/pact
    copying build/lib/pact/__version__.py -> /Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/pact
    copying build/lib/pact/consumer.py -> /Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/pact
    copying build/lib/pact/matchers.py -> /Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/pact
    copying build/lib/pact/verify.py -> /Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/pact
    copying build/lib/pact/pact.py -> /Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/pact
    byte-compiling /Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/pact/provider.py to provider.cpython-38.pyc
    byte-compiling /Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/pact/constants.py to constants.cpython-38.pyc
    byte-compiling /Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/pact/__init__.py to __init__.cpython-38.pyc
    byte-compiling /Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/pact/__version__.py to __version__.cpython-38.pyc
    byte-compiling /Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/pact/consumer.py to consumer.cpython-38.pyc
    byte-compiling /Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/pact/matchers.py to matchers.cpython-38.pyc
    byte-compiling /Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/pact/verify.py to verify.cpython-38.pyc
    byte-compiling /Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/pact/pact.py to pact.cpython-38.pyc
    running install_egg_info
    running egg_info
    writing pact_python.egg-info/PKG-INFO
    writing dependency_links to pact_python.egg-info/dependency_links.txt
    writing entry points to pact_python.egg-info/entry_points.txt
    writing requirements to pact_python.egg-info/requires.txt
    writing top-level names to pact_python.egg-info/top_level.txt
    reading manifest file 'pact_python.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    no previously-included directories found matching 'pact/test'
    no previously-included directories found matching 'pact/bin'
    no previously-included directories found matching 'e2e'
    writing manifest file 'pact_python.egg-info/SOURCES.txt'
    Copying pact_python.egg-info to /Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/pact_python-0.19.0-py3.8.egg-info
    running install_scripts
    Installing pact-verifier script to /Users/maksim.avanov/myproject/.venv/bin
    writing list of installed files to '/private/var/folders/jc/lkx1_cd52zlbqp9b5574_bjr5kfbm5/T/pip-record-fk8g3_51/install-record.txt'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/jc/lkx1_cd52zlbqp9b5574_bjr5kfbm5/T/pip-install-z7ite8wo/pact-python/setup.py", line 145, in <module>
        setup(**setup_args)
      File "/Users/maksim.avanov/myproject/.venv/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/nix/store/n72fdnrhg2p348z2z2c94ncxx0vm4wdm-python3-3.8.0/lib/python3.8/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/nix/store/n72fdnrhg2p348z2z2c94ncxx0vm4wdm-python3-3.8.0/lib/python3.8/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/nix/store/n72fdnrhg2p348z2z2c94ncxx0vm4wdm-python3-3.8.0/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/private/var/folders/jc/lkx1_cd52zlbqp9b5574_bjr5kfbm5/T/pip-install-z7ite8wo/pact-python/setup.py", line 54, in run
        install_ruby_app(bin_path)
      File "/private/var/folders/jc/lkx1_cd52zlbqp9b5574_bjr5kfbm5/T/pip-install-z7ite8wo/pact-python/setup.py", line 79, in install_ruby_app
        raise Exception(msg)
    Exception: Unfortunately, macOS-10.14.6-x86_64-i386-64bit is not a supported platform. Only Linux, Windows, and OSX are currently supported.

The corresponding nix shell is:

with (import (builtins.fetchGit {
  # Descriptive name to make the store path easier to identify
  name = "myproject";
  url = https://github.com/nixos/nixpkgs/;
  rev = "443f1a43ef629f1d0394641d769ef0c97f583404";
}) {});

stdenv.mkShell {
    name = "myproject";

    # The packages in the `buildInputs` list will be added to the PATH in our shell
    # Python-specific guide:
    # https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/python.section.md
    buildInputs = [
        # see https://nixos.org/nixos/packages.html
        # Python distribution
        python38Full
        # required for dev packages
        python38Packages.psutil
        python38Packages.virtualenv
        # needed for thriftpy2
        python38Packages.cython
        taglib
        libxml2
        libxslt
        libzip
        zlib
        # ssl
        libressl
        # root CA certificates
        cacert
        # git
        gitAndTools.gitFull
        # make
        gnumake
        which
        circleci-cli
        postgresql
    ] ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.IOKit darwin.apple_sdk.frameworks.CoreServices];
    shellHook = ''
        # set SOURCE_DATE_EPOCH so that we can use python wheels
        export SOURCE_DATE_EPOCH=$(date +%s)

        export VENV_PATH="$PWD/.venv"
        virtualenv $VENV_PATH

        export PATH=$VENV_PATH/bin:$PATH
        export PIP_CACHE_DIR=$PWD/.local/pip-cache
    '';
}

avanov avatar Oct 28 '19 13:10 avanov

It looks like behaviour of platform on OSX was changed in python 3.8

$ python3.6 -c 'import platform; print(platform.platform())'
Darwin-17.7.0-x86_64-i386-64bit
$ python3.8 -c 'import platform; print(platform.platform())'
macOS-10.13.6-x86_64-i386-64bit

Changed in version 3.8: On macOS, the function now uses mac_ver(), if it returns a non-empty release string, to get the macOS version rather than the darwin version.

https://docs.python.org/3/library/platform.html#platform.platform

ejrb avatar Dec 09 '19 11:12 ejrb

Thank you for your contribution @ejrb! As a mac user, who has been able to use pact-python on my mac with no issue, I salute you :)

YOU54F avatar May 03 '23 17:05 YOU54F