vscode点击运行按钮出现未期望的报错

137 阅读1分钟

报错信息

vscode连接远程linux环境,点击左上角的运行按钮报错

[Running] python -u "/home/xxx/xxx.py"
Traceback (most recent call last):
  File "/home/xxx/xxx.py", line 1, in <module>
    import transformers
ModuleNotFoundError: No module named 'transformers'

[Done] exited with code=1 in 0.035 seconds

解决方法:

点击左上角运行按钮的下拉框,点击Run Python File, 而不是Run Code