在 Ubuntu 上尝试将 Python 和 .kv 代码转换为 APK 文件时出现问题
这是我收到的错误。我使用的是 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 问题,因此如有必要,请随时告诉我添加任何信息。
谢谢。
下载声明: 本站所有软件和资料均为软件作者提供或网友推荐发布而来,仅供学习和研究使用,不得用于任何商业用途。如本站不慎侵犯你的版权请联系我,我将及时处理,并撤下相关内容!
-
我正在尝试在我的服务器上使用 apache2 配置 varnish cache 7。虽然设置 http 请求工作正常。但 varnish 无法直接处理 https,所以我尝试了 Apache 和 Hitch,但没有成功...
我正在尝试在我的服务器上使用 apache2 配置 varnish cache 7。虽然设置 http 请求工作正常。但 varnish 无法直接处理 https,因此我尝试了 Apache 和 Hitch,但没有成功。现在,如果有人能帮我找到仅适用于 varnish 和 Apache 的工作配置。我的另一个问题是,我必须使用两个虚拟主机吗? 在此处输入图像描述
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Apache HTTP Host ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ <VirtualHost *:8080> ServerName mycloud.com #ServerAdmin webmaster@localhost DocumentRoot /var/www/mycloud.com <Directory var/www/mycloud.com> Options Indexes FollowSymLinks AllowOverride All Order allow,deny allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Apache HTTPS Host ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ <IfModule mod_ssl.c> <VirtualHost *:443> ServerName mycloud.com DocumentRoot /var/www/mycloud.com ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined Include /etc/letsencrypt/options-ssl-apache.conf SSLCertificateFile /etc/letsencrypt/live/mycloud.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/mycloud.com/privkey.pem # Set up proxy headers ProxyRequests Off ProxyPreserveHost On ProxyAddHeaders On SSLProxyEngine On SSLProxyCheckPeerCN on SSLProxyCheckPeerExpire on # Add headers to prevent redirect loops RequestHeader set X-Forwarded-Proto "https" RequestHeader set X-Forwarded-Port "443" # Optional: Log forwarding headers for debugging LogLevel debug Header add X-Forwarded-Proto "https" env=HTTPS Header add X-Forwarded-Port "443" env=HTTPS ProxyPass /test http://127.0.0.1:80 ProxyPassReverse /test http://127.0.0.1:80 </VirtualHost> </IfModule> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Varnish VLC ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ vcl 4.0; backend default { .host = "127.0.0.1"; .port = "8080"; } sub vcl_recv { if (req.http.X-Forwarded-Proto ~ "https") { set req.http.X-Forwarded-Proto = "https"; } } sub vcl_backend_response { set beresp.http.X-Varnish = bereq.http.X-Varnish; } sub vcl_deliver { if (obj.hits > 0) { set resp.http.X-Cache = "HIT"; set resp.http.X-Cache-Hits = obj.hits; } else { set resp.http.X-Cache = "MISS"; } } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Varnish Service ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ [Unit] Description=Varnish Cache, a high-performance HTTP accelerator Documentation=https://www.varnish-cache.org/docs/ man:varnishd [Service] Type=simple # Maximum number of open files (for ulimit -n) LimitNOFILE=131072 # Locked shared memory - should suffice to lock the shared memory log # (varnishd -l argument) # Default log size is 80MB vsl + 1M vsm + header -> 82MB # unit is bytes LimitMEMLOCK=85983232 ExecStart=/usr/sbin/varnishd \ -j unix,user=vcache \ -F \ -a :80 \ -a localhost:6092,PROXY \ -p feature=+http2 \ -f /etc/varnish/default.vcl \ -s malloc,256m ExecReload=/usr/share/varnish/varnishreload ProtectSystem=full ProtectHome=true PrivateTmp=true PrivateDevices=true [Install] WantedBy=multi-user.target
我尝试使用 Hitch 终止 TLS,但配置对我来说太复杂了。所以没有成功。