问题描述 我在Ubuntu的pycharm里用pytorch训练神经网络 在github 上找了别人的代码里边有一句 _, term_width = os.popen('stty size', 'r').read().split() 运行时报错 解决方法 经百度,说把这行代码注释掉,给term_width一个确定值,有帖子给了80这个值,就像这样: # _, term_width = os.popen('stty size', 'r').read().split() term_width = 80