8wDlpd.png
8wDFp9.png
8wDEOx.png
8wDMfH.png
8wDKte.png

在 Ubuntu 上尝试将 Python 和 .kv 代码转换为 APK 文件时出现问题

Sara tabaghchi 2月前

42 0

这是我收到的错误。我使用的是 Ubuntu 24.04,我有一个简单的 Kivy 应用程序,其中包含一个 main.py 文件和 my.kv 文件。我也有 buildozer.spec 文件,但是当我需要获取 APK 时...

这是我收到的错误。我使用的是 Ubuntu 24.04,我有一个简单的 Kivy 应用程序,其中包含一个 main.py 文件和 my.kv 文件。我也有 buildozer.spec 文件,但是当我需要获取 APK 文件时,会弹出以下错误。

ish@ish-VirtualBox:~/kivyproject$ buildozer -v android debug
# Ensure build layout
# Create directory /home/ish/kivyproject/bin
# Check configuration tokens
# Preparing build
# Check requirements for android
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /usr/local/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/bin/keytool
# Install platform
# Run 'git config --get remote.origin.url' ...
# Cwd /home/ish/kivyproject/.buildozer/android/platform/python-for-android
https://github.com/kivy/python-for-android.git
# Run 'git branch -vv' ...
# Cwd /home/ish/kivyproject/.buildozer/android/platform/python-for-android
* master 957a3e5f [origin/master] Merge pull request #2959 from kivy/release-2024.01.21
# Run '/usr/bin/python3 -m pip install -q --user appdirs colorama>=0.3.3 jinja2 sh>=1.10, <2.0; sys_platform!="win32" build toml packaging setuptools' ...
# Cwd None
error: externally-managed-environment

× This environment is externally managed
> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
# Command failed: ('/usr/bin/python3', '-m', 'pip', 'install', '-q', '--user', 'appdirs', 'colorama>=0.3.3', 'jinja2', 'sh>=1.10, <2.0; sys_platform!="win32"', 'build', 'toml', 'packaging', 'setuptools')
# Error code: 1
# ENVIRONMENT:
#     SHELL = '/bin/bash'
#     SESSION_MANAGER = 'local/ish-VirtualBox:@/tmp/.ICE-unix/2059,unix/ish-VirtualBox:/tmp/.ICE-unix/2059'
#     QT_ACCESSIBILITY = '1'
#     COLORTERM = 'truecolor'
#     XDG_CONFIG_DIRS = '/etc/xdg/xdg-ubuntu:/etc/xdg'
#     XDG_MENU_PREFIX = 'gnome-'
#     GNOME_DESKTOP_SESSION_ID = 'this-is-deprecated'
#     GNOME_SHELL_SESSION_MODE = 'ubuntu'
#     SSH_AUTH_SOCK = '/run/user/1000/keyring/ssh'
#     MEMORY_PRESSURE_WRITE = 'c29tZSAyMDAwMDAgMjAwMDAwMAA='
#     XMODIFIERS = '@im=ibus'
#     DESKTOP_SESSION = 'ubuntu'
#     GTK_MODULES = 'gail:atk-bridge'
#     DBUS_STARTER_BUS_TYPE = 'session'
#     PWD = '/home/ish/kivyproject'
#     LOGNAME = 'ish'
#     XDG_SESSION_DESKTOP = 'ubuntu'
#     XDG_SESSION_TYPE = 'wayland'
#     SYSTEMD_EXEC_PID = '2059'
#     XAUTHORITY = '/run/user/1000/.mutter-Xwaylandauth.P7LQP2'
#     HOME = '/home/ish'
#     USERNAME = 'ish'
#     IM_CONFIG_PHASE = '1'
#     LANG = 'en_US.UTF-8'
#     LS_COLORS = 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:'
#     XDG_CURRENT_DESKTOP = 'ubuntu:GNOME'
#     MEMORY_PRESSURE_WATCH = '/sys/fs/cgroup/user.slice/user-1000.slice/[email protected]/app.slice/app-gnome\\x2dsession\\x2dmanager.slice/[email protected]/memory.pressure'
#     VTE_VERSION = '7600'
#     WAYLAND_DISPLAY = 'wayland-0'
#     GNOME_TERMINAL_SCREEN = '/org/gnome/Terminal/screen/6009e977_7532_431a_acea_9dd366fa6227'
#     GNOME_SETUP_DISPLAY = ':1'
#     LESSCLOSE = '/usr/bin/lesspipe %s %s'
#     XDG_SESSION_CLASS = 'user'
#     TERM = 'xterm-256color'
#     LESSOPEN = '| /usr/bin/lesspipe %s'
#     USER = 'ish'
#     GNOME_TERMINAL_SERVICE = ':1.105'
#     DISPLAY = ':0'
#     SHLVL = '1'
#     GSM_SKIP_SSH_AGENT_WORKAROUND = 'true'
#     QT_IM_MODULE = 'ibus'
#     DBUS_STARTER_ADDRESS = 'unix:path=/run/user/1000/bus,guid=0a88ef8a0bb0368fc5548f4f6673fcd1'
#     XDG_RUNTIME_DIR = '/run/user/1000'
#     DEBUGINFOD_URLS = 'https://debuginfod.ubuntu.com '
#     XDG_DATA_DIRS = '/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop'
#     PATH = '/home/ish/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/ish/.local/bin/'
#     GDMSESSION = 'ubuntu'
#     DBUS_SESSION_BUS_ADDRESS = 'unix:path=/run/user/1000/bus,guid=0a88ef8a0bb0368fc5548f4f6673fcd1'
#     _ = '/usr/local/bin/buildozer'
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

我从早上 8 点开始就一直在尝试解决这个问题,现在已经是下午 3 点了,所以可以肯定地说我尝试了很多。我尝试了很多不同的独特方法,但最终还是遇到了同样的问题。我尝试使用 Ubuntu、Google Colab 和 GitHub 来解决这个问题,但每次都遇到同样的错误。

这是我的第一个 Stack Overflow 问题,因此如有必要,请随时告诉我添加任何信息。

谢谢。

帖子版权声明 1、本帖标题:在 Ubuntu 上尝试将 Python 和 .kv 代码转换为 APK 文件时出现问题
    本站网址:http://xjnalaquan.com/
2、本网站的资源部分来源于网络,如有侵权,请联系站长进行删除处理。
3、会员发帖仅代表会员个人观点,并不代表本站赞同其观点和对其真实性负责。
4、本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
5、站长邮箱:yeweds@126.com 除非注明,本帖由Sara tabaghchi在本站《ubuntu》版块原创发布, 转载请注明出处!
最新回复 (0)
  • 我正在尝试运行 Block-STM 的台架测试,但一直遇到此错误:错误:无法运行“librocksdb-sys v6.20.3”的自定义构建命令,原因:进程未成功退出……

    的台架测试 Block-STM ,但一直遇到此错误:

    error: failed to run custom build command for `librocksdb-sys v6.20.3`
    
    Caused by:
      process didn't exit successfully: `/home/ubuntu/Block-STM/target/release/build/librocksdb-sys-06f571cb87f75164/build-script-build` (exit status: 101)
      --- stderr
      thread 'main' panicked at '"enum_(unnamed_at_rocksdb/include/rocksdb/c_h_854_1)" is not a valid Ident', /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.36/src/fallback.rs:708:9
      note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    

    我尝试安装 clang,下载并重建 rust-rocksdb,甚至安装了 ubuntu 的开发包。

    $ sudo apt-get install librocksdb-dev
    

    什么都没起作用。

    非常感谢任何帮助。

返回
作者最近主题: