Python 官方文档:入门教程 => 点击学习
错误现象: Traceback (most recent call last): File "/home/pi/ble-uart-peripheral/uart_peripheral.py", li
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
--结束END--
本文标题: No module named ‘yaml‘ 解决办法
本文链接: https://www.lsjlt.com/news/401756.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0