错误现象:
Traceback (most recent call last): File "/home/pi/ble-uart-peripheral/uart_peripheral.py", line 16, in <module> import yamlModuleNotFoundError: No module named 'yaml'
一般来说,命令行使用以下命令就能解决问题:
pip install yaml
但是,很遗憾,结果提示如下:
pi@pi:~/HeatMap $ pip install yamlLooking in indexes: https://pypi.org/simple, https://www.piwheels.org/simpleCollecting yaml Could not find a version that satisfies the requirement yaml (from versions: )No matching distribution found for yaml
其实正确的命令行内容应该是如下所示:
pip install pyyaml
结果显示成功
pi@pi:~/HeatMap $ pip install pyyamlLooking in indexes: https://pypi.org/simple, https://www.piwheels.org/simpleCollecting pyyaml Downloading https://files.pythonhosted.org/packages/a0/a4/d63f2d7597e1a4b55aa3b4d6c5b029991d3b824b5bd331af8d4ab1ed687d/PyYAML-5.4.1.tar.gz (175kB) 100% |████████████████████████████████| 184kB 481kB/s Installing build dependencies ... doneBuilding wheels for collected packages: pyyaml Running setup.py bdist_wheel for pyyaml ... done Stored in directory: /home/pi/.cache/pip/wheels/2a/d4/92/cf299bdf4162957ca8126b46e913e29f76a4f17ca762c45028Successfully built pyyamlInstalling collected packages: pyyamlSuccessfully installed pyyaml-5.4.1pi@pi:~/HeatMap $
来源地址:https://blog.csdn.net/jndingxin/article/details/125809878