Lua require package不可用

在升级了我的torch包之后,命令提示符中一切正常,但是,当我尝试通过命令行编写并运行脚本时,每个require包都无法使用。所有包都会提示相同的消息,例如 require 'torch'

module 'torch' not found:
    no field package.preload['torch']
    no file '/usr/local/share/lua/5.2/torch.lua'
    no file '/usr/local/share/lua/5.2/torch/init.lua'
    no file '/usr/local/lib/lua/5.2/torch.lua'
    no file '/usr/local/lib/lua/5.2/torch/init.lua'
    no file '/usr/share/lua/5.2/torch.lua'
    no file '/usr/share/lua/5.2/torch/init.lua'
    no file './torch.lua'
    no file '/usr/local/lib/lua/5.2/torch.so'
    no file '/usr/lib/x86_64-linux-gnu/lua/5.2/torch.so'
    no file '/usr/lib/lua/5.2/torch.so'
    no file '/usr/local/lib/lua/5.2/loadall.so'
    no file './torch.so'
点赞