Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems in aarch-64 (Termux, Android) #41

Open
vladko312 opened this issue May 22, 2023 · 0 comments
Open

Problems in aarch-64 (Termux, Android) #41

vladko312 opened this issue May 22, 2023 · 0 comments

Comments

@vladko312
Copy link

While trying to install pybluemonday in Termux, I encountered several issues:

From pip: installation error

Collecting pybluemonday
  Downloading pybluemonday-0.0.11.tar.gz (8.4 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: cffi~=1.1 in ./lib/python3.11/site-packages (from pybluemonday) (1.15.1)
Requirement already satisfied: pycparser in ./lib/python3.11/site-packages (from cffi~=1.1->pybluemonday) (2.21)
Building wheels for collected packages: pybluemonday
  Building wheel for pybluemonday (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [84 lines of output]
      uname_result(system='Linux', node='localhost', release='5.4.147-qgki-gd1d5e38bab33', version='#1 SMP PREEMPT Tue Dec 27 12:01:35 CST 2022 f2fs-hash:6cc067cd33', machine='aarch64')
      sh: ./scripts/setup-arm64.sh: inaccessible or not found
      make: *** No rule to make target 'clean'.  Stop.
      make: *** No rule to make target 'so'.  Stop.
      Requirement already satisfied: cffi~=1.1 in /data/data/com.termux/files/usr/lib/python3.11/site-packages (1.15.1)
      Requirement already satisfied: pycparser in /data/data/com.termux/files/usr/lib/python3.11/site-packages (from cffi~=1.1) (2.21)
      make: *** No rule to make target 'ffi'.  Stop.
      /data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
        warnings.warn(
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-cpython-311
      creating build/lib.linux-aarch64-cpython-311/pybluemonday
      copying pybluemonday/__init__.py -> build/lib.linux-aarch64-cpython-311/pybluemonday
      creating build/lib.linux-aarch64-cpython-311/tests
      copying tests/__init__.py -> build/lib.linux-aarch64-cpython-311/tests
      copying tests/test_memory_leaks.py -> build/lib.linux-aarch64-cpython-311/tests
      creating build/lib.linux-aarch64-cpython-311/tests/bluemonday
      copying tests/bluemonday/__init__.py -> build/lib.linux-aarch64-cpython-311/tests/bluemonday
      copying tests/bluemonday/test_policies.py -> build/lib.linux-aarch64-cpython-311/tests/bluemonday
      copying tests/bluemonday/test_sanitize.py -> build/lib.linux-aarch64-cpython-311/tests/bluemonday
      creating build/lib.linux-aarch64-cpython-311/tests/html_sanitizer
      copying tests/html_sanitizer/__init__.py -> build/lib.linux-aarch64-cpython-311/tests/html_sanitizer
      copying tests/html_sanitizer/test_sanitize.py -> build/lib.linux-aarch64-cpython-311/tests/html_sanitizer
      running build_ext
      $ GOPATH=/data/data/com.termux/files/usr/tmp/tmpg1syqv64 go get -d
      go: go.mod file not found in current directory or any parent directory.
          'go get' is no longer supported outside a module.
          To build and install a command, use 'go install' with a version,
          like 'go install example.com/cmd@latest'
          For more information, see https://golang.org/doc/go-get-install-deprecation
          or run 'go help get' or 'go help install'.
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/data/data/com.termux/files/usr/tmp/pip-install-2dhw2ike/pybluemonday_8930222d9674410e9bca3cc924e6ef3c/setup.py", line 49, in <module>
          setuptools.setup(
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
          self.run_command(cmd)
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/dist.py", line 1217, in run_command
          super().run_command(command)
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
          cmd_obj.run()
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 299, in run
          self.run_command('build')
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
          self.distribution.run_command(command)
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/dist.py", line 1217, in run_command
          super().run_command(command)
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
          cmd_obj.run()
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 132, in run
          self.run_command(cmd_name)
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
          self.distribution.run_command(command)
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/dist.py", line 1217, in run_command
          super().run_command(command)
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
          cmd_obj.run()
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 84, in run
          _build_ext.run(self)
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
          self.build_extensions()
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 466, in build_extensions
          self._build_extensions_serial()
        File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 492, in _build_extensions_serial
          self.build_extension(ext)
        File "/data/data/com.termux/files/usr/tmp/pip-install-2dhw2ike/pybluemonday_8930222d9674410e9bca3cc924e6ef3c/.eggs/setuptools_golang-2.7.0-py3.11.egg/setuptools_golang.py", line 155, in build_extension
          _check_call(cmd_get, cwd=pkg_path, env=env)
        File "/data/data/com.termux/files/usr/tmp/pip-install-2dhw2ike/pybluemonday_8930222d9674410e9bca3cc924e6ef3c/.eggs/setuptools_golang-2.7.0-py3.11.egg/setuptools_golang.py", line 110, in _check_call
          subprocess.check_call(cmd, cwd=cwd, env=dict(os.environ, **env))
        File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '('go', 'get', '-d')' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pybluemonday
  Running setup.py clean for pybluemonday
Failed to build pybluemonday
ERROR: Could not build wheels for pybluemonday, which is required to install pyproject.toml-based projects

From pip with go.mod from this repo in /data/data/com.termux/files/usr/: import error

Python 3.11.3 (main, Apr  7 2023, 00:39:07) [Clang 14.0.7 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0 on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pybluemonday
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pybluemonday/__init__.py", line 5, in <module>
    from pybluemonday.bluemonday import ffi, lib
ImportError: dynamic module does not define module export function (PyInit_bluemonday)
>>>

From source (setup.py install/setup.py bdist_wheel): import error

Python 3.11.3 (main, Apr  7 2023, 00:39:07) [Clang 14.0.7 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0 on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pybluemonday
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pybluemonday/__init__.py", line 5, in <module>
    from pybluemonday.bluemonday import ffi, lib
ImportError: dlopen failed: cannot locate symbol "_Py_NoneStruct" referenced by "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pybluemon>
>>>

How can they be resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant