作者:航模特异_831 | 来源:互联网 | 2023-09-17 09:34
本文由编程笔记#小编为大家整理,主要介绍了命令行运行py文件报错相关的知识,希望对你有一定的参考价值。
起因
今天用ubuntu 终端运行py文件报了个错,找不到模块?
我切换回pycharm
中运行,运行一切正常
解决
在报错模块中,插入绝对路径
import sys
sys.path.append(‘/opt/MVS/Samples/64/Python/GrabImage/‘)
参考:
https://blog.csdn.net/biglamp/article/details/90734574
https://www.cnblogs.com/liuyanhang/p/11018407.html