bobfang1992 / pytomlpp

A python wrapper for tomlplusplus
https://bobfang1992.github.io/pytomlpp/pytomlpp.html
MIT License
86 stars 11 forks source link

Unable to install on Android #57

Closed ghost closed 2 years ago

ghost commented 3 years ago

I'm trying to install pytomlpp in Termux on my OnePlus 5T and getting the following error:

$ poetry install
Installing dependencies from lock file
Package operations: 1 install, 0 updates, 0 removals
• Installing pytomlpp (1.0.2): Failed
EnvCommandError                                             
  Command ['/data/data/com.termux/files/home/foo/.venv/bin/pip', 'install', '--no-deps', 'file:///data/data/com.termux/files/home/.cache/pypoetry/artifacts/4f/1a/0a/2ed9fd009e9c994b1a3cab86ca72c3462a0ba23905de441062e07770d2/pytomlpp-1.0.2.tar.gz'] errored with the following return code 1, and output:
  Processing /data/data/com.termux/files/home/.cache/pypoetry/artifacts/4f/1a/0a/2ed9fd009e9c994b1a3cab86ca72c3462a0ba23905de441062e07770d2/pytomlpp-1.0.2.tar.gz
  Building wheels for collected packages: pytomlpp
    Building wheel for pytomlpp (setup.py): started
    Building wheel for pytomlpp (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /data/data/com.termux/files/home/foo/.venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/setup.py'"'"'; __file__='"'"'/data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /data/data/com.termux/files/usr/tmp/pip-wheel-kc5qcw56
         cwd: /data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/
    Complete output (18 lines):
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.linux-aarch64-3.9
    creating build/lib.linux-aarch64-3.9/pytomlpp
    copying src/pytomlpp/__init__.py -> build/lib.linux-aarch64-3.9/pytomlpp
    copying src/pytomlpp/_io.py -> build/lib.linux-aarch64-3.9/pytomlpp
    running build_ext
    building 'pytomlpp._impl' extension
    creating build/temp.linux-aarch64-3.9
    creating build/temp.linux-aarch64-3.9/src
    aarch64-linux-android-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -Iinclude -Ithird_party -I/data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/.eggs/pybind11-2.7.0-py3.9.egg/pybind11/include -I/data/data/com.termux/files/home/foo/.venv/include -I/data/data/com.termux/files/usr/include/python3.9 -c src/encoding_decoding.cpp -o build/temp.linux-aarch64-3.9/src/encoding_decoding.o -std=c++17
    src/encoding_decoding.cpp:1:10: fatal error: 'pytomlpp/pytomlpp.hpp' file not found
    #include <pytomlpp/pytomlpp.hpp>
             ^~~~~~~~~~~~~~~~~~~~~~~                              1 error generated.
    error: command '/data/data/com.termux/files/usr/bin/aarch64-linux-android-clang' failed with exit code 1
    ----------------------------------------
    ERROR: Failed building wheel for pytomlpp
    Running setup.py clean for pytomlpp
  Failed to build pytomlpp
  Installing collected packages: pytomlpp
      Running setup.py install for pytomlpp: started
      Running setup.py install for pytomlpp: finished with status 'error'
      ERROR: Command errored out with exit status 1:
       command: /data/data/com.termux/files/home/foo/.venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/setup.py'"'"'; __file__='"'"'/data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /data/data/com.termux/files/usr/tmp/pip-record-9ty6qt01/install-record.txt --single-version-externally-managed --compile --install-headers /data/data/com.termux/files/home/foo/.venv/include/site/python3.9/pytomlpp
           cwd: /data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/
           Complete output (18 lines):
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-3.9
      creating build/lib.linux-aarch64-3.9/pytomlpp
      copying src/pytomlpp/__init__.py -> build/lib.linux-aarch64-3.9/pytomlpp
      copying src/pytomlpp/_io.py -> build/lib.linux-aarch64-3.9/pytomlpp
      running build_ext
      building 'pytomlpp._impl' extension
      creating build/temp.linux-aarch64-3.9
      creating build/temp.linux-aarch64-3.9/src
      aarch64-linux-android-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -Iinclude -Ithird_party -I/data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/.eggs/pybind11-2.7.0-py3.9.egg/pybind11/include -I/data/data/com.termux/files/home/foo/.venv/include -I/data/data/com.termux/files/usr/include/python3.9 -c src/encoding_decoding.cpp -o build/temp.linux-aarch64-3.9/src/encoding_decoding.o -std=c++17
      src/encoding_decoding.cpp:1:10: fatal error: 'pytomlpp/pytomlpp.hpp' file not found
      #include <pytomlpp/pytomlpp.hpp>
               ^~~~~~~~~~~~~~~~~~~~~~~
               1 error generated.
      error: command '/data/data/com.termux/files/usr/bin/aarch64-linux-android-clang' failed with exit code 1
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /data/data/com.termux/files/home/foo/.venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/setup.py'"'"'; __file__='"'"'/data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /data/data/com.termux/files/usr/tmp/pip-record-9ty6qt01/install-record.txt --single-version-externally-managed --compile --install-headers /data/data/com.termux/files/home/foo/.venv/include/site/python3.9/pytomlpp
  Check the logs for full command output.

  at /data/data/com.termux/files/usr/lib/python3.9/site-packages/poetry/utils/env.py:1101 in _run
      1097│                 output = subprocess.check_output(
      1098│                     cmd, stderr=subprocess.STDOUT, **kwargs
      1099│                 )
      1100│         except CalledProcessError as e:
    → 1101│             raise EnvCommandError(e, input=input_)
      1102|
      1103│         return decode(output)
      1104|
      1105│     def execute(self, bin, *args, **kwargs):
bobfang1992 commented 3 years ago

Thanks for reporting, I will take a look later this week @nyuszika7h

JaiKishan132 commented 3 years ago

@bobfang1992 any update on the issue?

sidnarayanan commented 3 years ago

I'd like to add that I can reproduce this on an M1 mac using python3.9 from miniforge. Possibly a issue common to arm64?

sidnarayanan commented 3 years ago

One more bit of info: installing from source works just fine. It's the pip wheel install that breaks. Might be an intermediate solution @nyuszika7h

bobfang1992 commented 3 years ago

Hi all, I added support for Apple M1 in a recent release (v1.0.3), could you try it out? @sidnarayanan For Linux ARM. It seems to me that cibuildwheel which is the tool we use for building the wheels, seems does not support it. I am still searching for a way to do this. I will let you know if I made any progress.

@nyuszika7h @JaiKishan132

bobfang1992 commented 2 years ago

Closing this as I can confirm it is working with M1 Mac. pip version is 21.3.1

bobfang1992 commented 2 years ago

I'm trying to install pytomlpp in Termux on my OnePlus 5T and getting the following error:

$ poetry install
Installing dependencies from lock file
Package operations: 1 install, 0 updates, 0 removals
• Installing pytomlpp (1.0.2): Failed
EnvCommandError                                             
  Command ['/data/data/com.termux/files/home/foo/.venv/bin/pip', 'install', '--no-deps', 'file:///data/data/com.termux/files/home/.cache/pypoetry/artifacts/4f/1a/0a/2ed9fd009e9c994b1a3cab86ca72c3462a0ba23905de441062e07770d2/pytomlpp-1.0.2.tar.gz'] errored with the following return code 1, and output:
  Processing /data/data/com.termux/files/home/.cache/pypoetry/artifacts/4f/1a/0a/2ed9fd009e9c994b1a3cab86ca72c3462a0ba23905de441062e07770d2/pytomlpp-1.0.2.tar.gz
  Building wheels for collected packages: pytomlpp
    Building wheel for pytomlpp (setup.py): started
    Building wheel for pytomlpp (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /data/data/com.termux/files/home/foo/.venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/setup.py'"'"'; __file__='"'"'/data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /data/data/com.termux/files/usr/tmp/pip-wheel-kc5qcw56
         cwd: /data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/
    Complete output (18 lines):
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.linux-aarch64-3.9
    creating build/lib.linux-aarch64-3.9/pytomlpp
    copying src/pytomlpp/__init__.py -> build/lib.linux-aarch64-3.9/pytomlpp
    copying src/pytomlpp/_io.py -> build/lib.linux-aarch64-3.9/pytomlpp
    running build_ext
    building 'pytomlpp._impl' extension
    creating build/temp.linux-aarch64-3.9
    creating build/temp.linux-aarch64-3.9/src
    aarch64-linux-android-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -Iinclude -Ithird_party -I/data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/.eggs/pybind11-2.7.0-py3.9.egg/pybind11/include -I/data/data/com.termux/files/home/foo/.venv/include -I/data/data/com.termux/files/usr/include/python3.9 -c src/encoding_decoding.cpp -o build/temp.linux-aarch64-3.9/src/encoding_decoding.o -std=c++17
    src/encoding_decoding.cpp:1:10: fatal error: 'pytomlpp/pytomlpp.hpp' file not found
    #include <pytomlpp/pytomlpp.hpp>
             ^~~~~~~~~~~~~~~~~~~~~~~                              1 error generated.
    error: command '/data/data/com.termux/files/usr/bin/aarch64-linux-android-clang' failed with exit code 1
    ----------------------------------------
    ERROR: Failed building wheel for pytomlpp
    Running setup.py clean for pytomlpp
  Failed to build pytomlpp
  Installing collected packages: pytomlpp
      Running setup.py install for pytomlpp: started
      Running setup.py install for pytomlpp: finished with status 'error'
      ERROR: Command errored out with exit status 1:
       command: /data/data/com.termux/files/home/foo/.venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/setup.py'"'"'; __file__='"'"'/data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /data/data/com.termux/files/usr/tmp/pip-record-9ty6qt01/install-record.txt --single-version-externally-managed --compile --install-headers /data/data/com.termux/files/home/foo/.venv/include/site/python3.9/pytomlpp
           cwd: /data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/
           Complete output (18 lines):
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-3.9
      creating build/lib.linux-aarch64-3.9/pytomlpp
      copying src/pytomlpp/__init__.py -> build/lib.linux-aarch64-3.9/pytomlpp
      copying src/pytomlpp/_io.py -> build/lib.linux-aarch64-3.9/pytomlpp
      running build_ext
      building 'pytomlpp._impl' extension
      creating build/temp.linux-aarch64-3.9
      creating build/temp.linux-aarch64-3.9/src
      aarch64-linux-android-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -Iinclude -Ithird_party -I/data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/.eggs/pybind11-2.7.0-py3.9.egg/pybind11/include -I/data/data/com.termux/files/home/foo/.venv/include -I/data/data/com.termux/files/usr/include/python3.9 -c src/encoding_decoding.cpp -o build/temp.linux-aarch64-3.9/src/encoding_decoding.o -std=c++17
      src/encoding_decoding.cpp:1:10: fatal error: 'pytomlpp/pytomlpp.hpp' file not found
      #include <pytomlpp/pytomlpp.hpp>
               ^~~~~~~~~~~~~~~~~~~~~~~
               1 error generated.
      error: command '/data/data/com.termux/files/usr/bin/aarch64-linux-android-clang' failed with exit code 1
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /data/data/com.termux/files/home/foo/.venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/setup.py'"'"'; __file__='"'"'/data/data/com.termux/files/usr/tmp/pip-req-build-5620zu6p/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /data/data/com.termux/files/usr/tmp/pip-record-9ty6qt01/install-record.txt --single-version-externally-managed --compile --install-headers /data/data/com.termux/files/home/foo/.venv/include/site/python3.9/pytomlpp
  Check the logs for full command output.

  at /data/data/com.termux/files/usr/lib/python3.9/site-packages/poetry/utils/env.py:1101 in _run
      1097│                 output = subprocess.check_output(
      1098│                     cmd, stderr=subprocess.STDOUT, **kwargs
      1099│                 )
      1100│         except CalledProcessError as e:
    → 1101│             raise EnvCommandError(e, input=input_)
      1102|
      1103│         return decode(output)
      1104|
      1105│     def execute(self, bin, *args, **kwargs):

this should be fixed with 1.0.6.

mattip commented 2 years ago

I was getting something similar from a git checkout, then I noticed I needed to get the submodules git submodule update --init