进口PICAMERA2在Thonny IDE的CLI BOT中工作
我已经成功安装了PICAMERA2,使用此我可以从CLI中运行一个脚本。脚本:
from picamera2.picamera2 import *
from time import sleep
picam2 = Picamera2()
picam2.start_preview(Preview.QTGL)
config = picam2.preview_configuration()
picam2.configure(config)
picam2.start()
sleep(5)
然后我在终端python script_name.py
中运行它,并且它可以根据应有的效果。但是,当我在Thonny Ide中运行它时,脚本会返回:
modulenotfounderror:没有名为'picamera2'
的模块
为我的知识称为“ PicAmera2”,我已经在Thonny \ usr \ bin \ bin \ python3
中设置了默认解释器,并也尝试了\ usr \ usr \ bin \ python \ python \ python \ python3.9
和\ usr \ bin \ python
- 它们似乎都指向Python版本3.9.2-这也是运行Python -v
ore 时在终端中显示的版本代码> python3 -v 。我想念什么或错误地做什么?
I have successfully installed picamera2 using this tutorial and I am able to run a script just fine from CLI. The script:
from picamera2.picamera2 import *
from time import sleep
picam2 = Picamera2()
picam2.start_preview(Preview.QTGL)
config = picam2.preview_configuration()
picam2.configure(config)
picam2.start()
sleep(5)
And I run it in terminal python script_name.py
and it works as it should. But when I run it in Thonny IDE the script returns:
ModuleNotFoundError: No module named 'picamera2'
To my knowledge I have set the default interpreter in Thonny \usr\bin\python3
and tried also with \usr\bin\python3.9
and \usr\bin\python
- they all seem to point to python version 3.9.2 - which is also the version displayed in terminal when running python -V
or python3 -V
. What am I missing or doing incorrectly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)