Khurram Amin
Khurram Amin

Reputation: 172

require('image') not working in Torch7

I have installed 'image' package using luarocks

$ luarocks  install image

and everything gets installed without any error. Whenever I try to use it the following error is returned:

> th> require('image')
>
> /home/khurram/torch/install/share/lua/5.1/trepl/init.lua:384:
> /home/khurram/torch/install/share/lua/5.1/trepl/init.lua:384: module
> 'sys.fpath' not found:No LuaRocks module found for sys.fpath  no field
> package.preload['sys.fpath']  no file
> '/home/khurram/.luarocks/share/lua/5.1/sys/fpath.lua'     no file
> '/home/khurram/.luarocks/share/lua/5.1/sys/fpath/init.lua'    no file
> '/home/khurram/torch/install/share/lua/5.1/sys/fpath.lua'     no file
> '/home/khurram/torch/install/share/lua/5.1/sys/fpath/init.lua'    no
> file './sys/fpath.lua'    no file
> '/home/khurram/torch/install/share/luajit-2.1.0-beta1/sys/fpath.lua'
>   no file '/usr/local/share/lua/5.1/sys/fpath.lua'    no file
> '/usr/local/share/lua/5.1/sys/fpath/init.lua'     no file
> '/home/khurram/.luarocks/lib/lua/5.1/sys/fpath.so'    no file
> '/home/khurram/torch/install/lib/lua/5.1/sys/fpath.so'    no file
> '/home/khurram/torch/install/lib/sys/fpath.so'    no file
> './sys/fpath.so'  no file '/usr/local/lib/lua/5.1/sys/fpath.so'   no
> file '/usr/local/lib/lua/5.1/loadall.so'  no file
> '/home/khurram/.luarocks/lib/lua/5.1/sys.so'  no file
> '/home/khurram/torch/install/lib/lua/5.1/sys.so'  no file
> '/home/khurram/torch/install/lib/sys.so'  no file './sys.so'  no file
> '/usr/local/lib/lua/5.1/sys.so'   no file
> '/usr/local/lib/lua/5.1/loadall.so' stack traceback:  [C]: in function
> 'error'   /home/khurram/torch/install/share/lua/5.1/trepl/init.lua:384:
> in function 'require'     [string "_RESULT={require "image"}"]:1: in main
> chunk     [C]: in function 'xpcall'
>   /home/khurram/torch/install/share/lua/5.1/trepl/init.lua:651: in
> function 'repl'
>   ...rram/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:199: in
> main chunk    [C]: at 0x00406670

Can anybody please help me in this? I am a newbie in Torch7 & LUA.

PS: I am running Ubuntu 14.04 and have installed Torch7 according to the official instructions and everything else is working fine.

Upvotes: 3

Views: 3020

Answers (1)

ui_90jax
ui_90jax

Reputation: 759

Hit the same problem. Doing

luarocks install sys

as well worked for me. Not sure what happened to sys with the image install.

Upvotes: 7

Related Questions