【发布时间】:2019-11-11 03:46:58
【问题描述】:
我正在为我的 Arduino UNO 编写代码,并按照教程进行操作,因为这是我第一次在 Arduino UNO 上使用 python。教程中的那个人使用了pip.main。我只是想开始编写代码。我正在使用 Python 3.7.5 和 pip 版本 19.2.3。我已经尝试在 Stack Overflow 和其他类似网站上四处寻找,但社区建议的所有内容都不起作用。我也有非常有限的时间来解决这个问题。这是我的代码:
try:
from pyfirmata import Arduino, util
except:
#the problem is here
from pip._internal import main
main(['install', 'pyfirmara'])
from pyfirmata import Arduino, util
board = Arduino('')
iterator = util.Iterator(board)
iterator.start()
#code here
board.exit()
我们将不胜感激!
【问题讨论】:
-
pip的界面发生了变化。一般来说,以下划线开头的名称被认为是私有的,可能会更改,恕不另行通知。你不应该依赖它们。
标签: python python-3.x windows pip arduino-uno