将Biopython包装在适用于android的Kivy中

2024-05-23 20:27:40 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试在kivy android中使用Biopython模块

CryptoWatch-Kivy          1.13
Kivy                      2.0.0
Kivy-Garden               0.1.4
kivy-garden.wordcloud     1.0.0
kivymd                    0.104.2.dev0

我试图安装最新的Biopython,但在我成功地将其打包到Android中后,它出现了一个错误。 adb日志显示这是一个32位冲突

05-08 23:27:50.290  3431  3519 I python  :    File "/media/ken/Data/Kivy_env/Kivy2Py3.8.1MD0.104.2.dev0/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/KarobbenTB/Bio/Align/__init__.py", line 20, in <module>
05-08 23:27:50.290  3431  3519 I python  :  ImportError: dlopen failed: "/data/data/kivy.karobbentb/files/app/_python_bundle/site-packages/Bio/Align/_aligners.so" is 64-bit instead of 32-bit
05-08 23:27:50.291  3431  3519 I python  : Python for android ended.

因此,我尝试安装一个像biopython==1.69这样的旧版本,但未能打包。 错误代码一直在说numpy是必需的,尽管numpy是在requirment中写入的

  Created temporary directory: /tmp/pip-record-cnwyu_hf
    Running command /media/ken/Data/Kivy_env/.buildozer/android/platform/build-armeabi-v7a/build/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ka_8hq1b/biopython_ff1e53ff0ece494eb2ac9c314d6f1845/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ka_8hq1b/biopython_ff1e53ff0ece494eb2ac9c314d6f1845/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 /tmp/pip-record-cnwyu_hf/install-record.txt --single-version-externally-managed --home /tmp/pip-target-lv8vtbih --compile --install-headers include/site/python3.8/biopython
    Ignoring "sys._home = value" override
    running install
    Missing required dependency NumPy (Numerical Python).

    Unless running under Jython or IronPython, we require NumPy be installed
    when compiling Biopython. See http://www.numpy.org for details.

    Running setup.py install for biopython ... error
ERROR: Command errored out with exit status 1: /media/ken/Data/Kivy_env/.buildozer/android/platform/build-armeabi-v7a/build/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ka_8hq1b/biopython_ff1e53ff0ece494eb2ac9c314d6f1845/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ka_8hq1b/biopython_ff1e53ff0ece494eb2ac9c314d6f1845/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 /tmp/pip-record-cnwyu_hf/install-record.txt --single-version-externally-managed --home /tmp/pip-target-lv8vtbih --compile --install-headers include/site/python3.8/biopython Check the logs for full command output.
Exception information:
Traceback (most recent call last):
  File "/media/ken/Data/Kivy_env/Kivy2Py3.8.1MD0.104.2.dev0/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 806, in install
    success = install_legacy(
  File "/media/ken/Data/Kivy_env/Kivy2Py3.8.1MD0.104.2.dev0/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/operations/install/legacy.py", line 81, in install
    raise LegacyInstallFailure
pip._internal.operations.install.legacy.LegacyInstallFailure

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/media/ken/Data/Kivy_env/Kivy2Py3.8.1MD0.104.2.dev0/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 180, in _main
    status = self.run(options, args)
  File "/media/ken/Data/Kivy_env/Kivy2Py3.8.1MD0.104.2.dev0/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 204, in wrapper
    return func(self, options, args)
  File "/media/ken/Data/Kivy_env/Kivy2Py3.8.1MD0.104.2.dev0/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 393, in run
    installed = install_given_reqs(
  File "/media/ken/Data/Kivy_env/Kivy2Py3.8.1MD0.104.2.dev0/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/req/__init__.py", line 77, in install_given_reqs
    requirement.install(
  File "/media/ken/Data/Kivy_env/Kivy2Py3.8.1MD0.104.2.dev0/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 824, in install
    six.reraise(*exc.parent)
  File "/media/ken/Data/Kivy_env/Kivy2Py3.8.1MD0.104.2.dev0/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_vendor/six.py", line 703, in reraise
    raise value
  File "/media/ken/Data/Kivy_env/Kivy2Py3.8.1MD0.104.2.dev0/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/operations/install/legacy.py", line 69, in install
    runner(
  File "/media/ken/Data/Kivy_env/Kivy2Py3.8.1MD0.104.2.dev0/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/utils/subprocess.py", line 274, in runner
    call_subprocess(
  File "/media/ken/Data/Kivy_env/Kivy2Py3.8.1MD0.104.2.dev0/.buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.8/site-packages/pip/_internal/utils/subprocess.py", line 244, in call_subprocess
    raise InstallationSubprocessError(proc.returncode, command_desc)
pip._internal.exceptions.InstallationSubprocessError: Command errored out with exit status 1: /media/ken/Data/Kivy_env/.buildozer/android/platform/build-armeabi-v7a/build/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ka_8hq1b/biopython_ff1e53ff0ece494eb2ac9c314d6f1845/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ka_8hq1b/biopython_ff1e53ff0ece494eb2ac9c314d6f1845/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 /tmp/pip-record-cnwyu_hf/install-record.txt --single-version-externally-managed --home /tmp/pip-target-lv8vtbih --compile --install-headers include/site/python3.8/biopython Check the logs for full command output.
Removed build tracker: '/tmp/pip-req-tracker-8kk4o4l_'


  STDERR:

有没有办法用kivy打包android中的Biopython

我在bulldozer.spec中的要求

requirements = kivy==2.0.0, https://github.com/kivymd/KivyMD/archive/master.zip,
  numpy, pillow==8.0.0, pypinyin,
  opencc-python-reimplemented, docutils, android,
  biopython==1.69

Tags: installpippybuildenvdatasitemedia