【问题标题】:Buildozer: ModuleNotFoundError: No module named 'yaml'Buildozer:ModuleNotFoundError:没有名为“yaml”的模块
【发布时间】:2020-11-05 02:38:02
【问题描述】:

运行 buildozer 并出现错误:

$ buildozer -v android debug deploy run logcat
ERROR: Could not find a version that satisfies the requirement yaml (from -r requirements.txt (line 2)) (from versions: none)`
ERROR: No matching distribution found for yaml (from -r requirements.txt (line 2))`

但是该模块似乎已安装:

$ pip3 show pyyaml | grep Version
Version: 5.3.1
$ python
>>> import yaml
>>>

buildozer.spec 中当然提到了该模块:

requirements = python3,kivy,yaml

整个应用程序运行正常且没有错误

$ python main.py
  • Python 3.7.7
  • Buildozer 1.2.0
  • PyYAML:5.3.1

【问题讨论】:

    标签: python-3.x yaml buildozer pyyaml


    【解决方案1】:

    这里的问题是 yaml 与 pyyaml。

    在 python 中你导入 yaml,但要安装它并在 buildozer 中引用你使用 pyyaml

    buildozer.spec:

    requirements = python3,kivy,pyyaml
    

    要检查您是否安装了它,请运行提到的pip3 show pyyaml | grep Version

    或者尝试在python中导入>>> import yaml 如果您没有安装它,只需输入

    pip install pyyaml
    

    希望这对某人有所帮助。

    【讨论】:

      猜你喜欢
      • 2018-11-24
      • 1970-01-01
      • 2020-03-27
      • 2020-07-30
      • 1970-01-01
      • 2016-11-03
      • 1970-01-01
      • 1970-01-01
      • 2018-01-19
      相关资源
      最近更新 更多