我做了一个简单的kivy应用程序也使用套接字模块。但是当我尝试使用google collab和buildozer将其转换为android应用程序时,我得到了这种错误。
{
ERROR: Could not find a version that satisfies the requirement socket (from versions: none)
ERROR: No matching distribution found for socket
STDERR:
# Command failed: /usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=starstocksapp --bootstrap=sdl2 --requirements=python3,socket,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/content/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21
# ENVIRONMENT:
# CUDNN_VERSION = '8.0.5.39'
# PYDEVD_USE_FRAME_EVAL = 'NO'
# LD_LIBRARY_PATH = '/usr/local/nvidia/lib:/usr/local/nvidia/lib64'
# CLOUDSDK_PYTHON = 'python3'
# LANG = 'en_US.UTF-8'
# HOSTNAME = '047d4a118941'
# OLDPWD = '/'
# CLOUDSDK_CONFIG = '/content/.config'
# NVIDIA_VISIBLE_DEVICES = 'all'
# DATALAB_SETTINGS_OVERRIDES = '{"kernelManagerProxyPort":6000,"kernelManagerProxyHost":"172.28.0.3","jupyterArgs":["--ip=\"172.28.0.2\""],"debugAdapterMultiplexerPath":"/usr/local/bin/dap_multiplexer","enableLsp":true}'
# ENV = '/root/.bashrc'
# PAGER = 'cat'
# NCCL_VERSION = '2.7.8'
# TF_FORCE_GPU_ALLOW_GROWTH = 'true'
# JPY_PARENT_PID = '53'
# NO_GCE_CHECK = 'True'
# PWD = '/content'
# HOME = '/root'
# LAST_FORCED_REBUILD = '20211007'
# CLICOLOR = '1'
# DEBIAN_FRONTEND = 'noninteractive'
# LIBRARY_PATH = '/usr/local/cuda/lib64/stubs'
# GCE_METADATA_TIMEOUT = '0'
# GLIBCPP_FORCE_NEW = '1'
# TBE_CREDS_ADDR = '172.28.0.1:8008'
# TERM = 'xterm-color'
# SHELL = '/bin/bash'
# GCS_READ_CACHE_BLOCK_SIZE_MB = '16'
# PYTHONWARNINGS = 'ignore:::pip._internal.cli.base_command'
# MPLBACKEND = 'module://ipykernel.pylab.backend_inline'
# CUDA_VERSION = '11.1.1'
# NVIDIA_DRIVER_CAPABILITIES = 'compute,utility'
# SHLVL = '1'
# PYTHONPATH = '/env/python'
# NVIDIA_REQUIRE_CUDA = ('cuda>=11.1 brand=tesla,driver>=418,driver<419 '
'brand=tesla,driver>=440,driver<441 brand=tesla,driver>=450,driver<451')
# COLAB_GPU = '0'
# GLIBCXX_FORCE_NEW = '1'
# PATH = '/root/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/tools/node/bin:/tools/google-cloud-sdk/bin:/opt/bin'
# LD_PRELOAD = '/usr/lib/x86_64-linux-gnu/libtcmalloc.so.4'
# GIT_PAGER = 'cat'
# _ = '/usr/local/bin/buildozer'
# PACKAGES_PATH = '/root/.buildozer/android/packages'
# ANDROIDSDK = '/root/.buildozer/android/platform/android-sdk'
# ANDROIDNDK = '/root/.buildozer/android/platform/android-ndk-r19c'
# ANDROIDAPI = '27'
# ANDROIDMINAPI = '21'
#
# 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
}
我不知道为什么这个错误总是出现。我在目录中有main.py,我已经检查了安装所有模块。
我认为套接字模块不包括或一些问题是由于我包括套接字模块。我已经在规范文件中编写了套接字模块的名称,也在要包含的模块中。
Thanks in Advance.
您不必在buildozer的要求中添加套接字。Spec文件,因为它们是python中的内置模块。因此,当您在需求中添加python3时,它们将自动添加。
更多信息请看这篇文章:编译器在为android打包时没有使用正确的kivy版本