解决ubuntu操作系统下libjpeg package not found, please install libjpeg

今天在ubuntu下运行一个用python和Torch编写的程序,报红色的错误如题,

        /home/viriya/torch/install/share/lua/5.1/trepl/init.lua:389: module 'libjpeg' not found:No LuaRocks module found for libjpeg
        no field package.preload['libjpeg']
        no file '/home/viriya/.luarocks/share/lua/5.1/libjpeg.lua'
        no file '/home/viriya/.luarocks/share/lua/5.1/libjpeg/init.lua'
        no file '/home/viriya/torch/install/share/lua/5.1/libjpeg.lua'
        no file '/home/viriya/torch/install/share/lua/5.1/libjpeg/init.lua'
        no file './libjpeg.lua'
        no file '/home/viriya/torch/install/share/luajit-2.1.0-beta1/libjpeg.lua'
        no file '/usr/local/share/lua/5.1/libjpeg.lua'
        no file '/usr/local/share/lua/5.1/libjpeg/init.lua'
        no file '/home/viriya/.luarocks/lib/lua/5.1/libjpeg.so'
        no file '/home/viriya/torch/install/lib/lua/5.1/libjpeg.so'
        no file '/home/viriya/torch/install/lib/libjpeg.so'
        no file './libjpeg.so'
        no file '/usr/local/lib/lua/5.1/libjpeg.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
warning: <libjpeg> could not be loaded (is it installed?)

        /home/viriya/torch/install/share/lua/5.1/dok/inline.lua:738: <image.loadJPG> libjpeg package not found, please install libjpeg
        stack traceback:
        [C]: in function 'error'
        /home/viriya/torch/install/share/lua/5.1/dok/inline.lua:738: in function 'error'
        /home/viriya/torch/install/share/lua/5.1/image/init.lua:232: in function 'loader'
        /home/viriya/torch/install/share/lua/5.1/image/init.lua:388: in function 'load'
        run_model.lua:67: in function 'run_image'
        run_model.lua:164: in main chunk
        [C]: in function 'dofile'
        ...riya/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
        [C]: at 0x7f2220809570

用sudo apt-get install libjpeg和pip install libjpeg、sudo apt-get install libjpeg-dev都不行,还重新下载编译libjpeg.git也不行,然后在网上查到这样重新安装image:sudo ~/torch/install/bin/luarocks install image,终于解决了。

        之前在cmd运行过luarocks install image,为什么要这样运行才解决了呢?sudo ~/torch/install/bin/luarocks install image

我想应该是不加sudo和加sudo运行安装后不一样吧。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

xqlily

鼓励原创

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值