Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: No results matching query were found. for luarocks in ubuntu

I'm totally new in Lua. And here is what I've done on my new virtual Ubuntu. First I install the lua-5.3.4 which is download from their official website.

make linux
make install

And this is the README.md of the dependency lib suggesting I do.

luarocks install torch
luarocks install nn
luarocks install dpnn
luarocks install torchx
luarocks install rnn

However, it always return me this error message no matter where I use them.

Error: No results matching query were found.

So I follow the suggestion I found on here to install torch from http://torch.ch/docs/getting-started.html

This is what I do

git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; bash install-deps;
./install.sh
source ~/.bashrc

All of this commands are under mycount

vera@ubuntu:~/Documents/relation inference$

Then I try again to install the dependency and fail again.

sudo luarocks install rnn
sudo luarocks install nn
sudo luarocks install torch

I switch to the root count by sudo su. Then while I do luarocks install nn again. I got this:

root@ubuntu:/home/vera/Documents/relation inference# luarocks install nn
Installing https://rocks.moonscript.org/nn-1.0.4-1.src.rock...
Using https://rocks.moonscript.org/nn-1.0.4-1.src.rock... switching to 'build' mode
gcc -O2 -fPIC -I/usr/include/lua5.1 -c lnn.c -o lnn.o
lnn.c:4:23: fatal error: nanomsg/nn.h: 没有那个文件或目录(this means :no that file or the dict)
compilation terminated.

Error: Build error: Failed compiling object lnn.o

While I use the other command under root, I still got the same error message.

root@ubuntu:/home/vera/Documents/relation inference# luarocks install rnn
Error: No results matching query were found.

root@ubuntu:/home/vera/Documents/relation inference# luarocks install torch
Error: No results matching query were found.

root@ubuntu:/home/vera/Documents/relation inference#  luarocks install torch7-master
Error: No results matching query were found.

I already downloaded the dependency from GitHub.

like image 802
vera Avatar asked Mar 05 '17 07:03

vera


3 Answers

To solve it follow these steps:

sudo apt install luarocks
sudo ~/torch/install/bin/luarocks install nn
like image 110
Eslam Saber Avatar answered Oct 20 '22 17:10

Eslam Saber


Finally I solved my issues by this way.

Error: No results matching query were found. for luarocks in ubuntu you can find the detail of the solution on my blog.

The follow is what I did.


First I find that I didn't install torch in fact though I did what the offical web site told me and installed it for 3 times.(And I still don't know why.) you can test if you have successed install the torch byth

> th
  ______             __   |  Torch7 
 /_  __/__  ________/ /   |  Scientific computing for Lua. 
  / / / _ \/ __/ __/ _ \  |  Type ? for help 
 /_/  \___/_/  \__/_//_/  |  https://github.com/torch 
                          |  http://torch.ch 

Then maybe you will still find the command luarocks install xxx useless.Continue.

this is the solution which I finally found useful.(This is in Chinese.If you don't understand,you can see what I write down.)

Download all of the dependency on github,unzip,and cd into the dict.

luarocks install nn-master/rocks/nn-scm-1.rockspec
luarocks install rnn-master/rocks/rnn-scm-1.rockspec

the most important point is that you need to find where is the .rockspec

Here is some dependencies's location.And you may find they are not always in a same format.

luarocks install torchx-master/torchx-scm-1.rockspec
luarocks install Moses-master/rockspec/moses-1.4.0-1.rockspec
luarocks install dpnn-master/rocks/dpnn-scm-1.rockspec
luarocks install rnn-master/rocks/rnn-scm-1.rockspec
luarocks install optim-master/optim-1.0.5-0.rockspec

During install,this is what you may get.

pnn-scm-1.rockspec
Using dpnn-master/rocks/dpnn-scm-1.rockspec... switching to 'build' mode

Missing dependencies for dpnn:
moses >= 1.3.1

mkdir: 无法创建目录"/home/vera/.cache/luarocks/https___raw.githubusercontent.com_torch_rocks_master": 权限不够
mkdir: 无法创建目录"/home/vera/.cache/luarocks/https___raw.githubusercontent.com_torch_rocks_master": 权限不够
mkdir: 无法创建目录"/home/vera/.cache/luarocks/https___raw.githubusercontent.com_torch_rocks_master": 权限不够
Warning: Failed searching manifest: Failed creating temporary cache directory /home/vera/.cache/luarocks/https___raw.githubusercontent.com_torch_rocks_master
mkdir: 无法创建目录"/home/vera/.cache/luarocks/https___raw.githubusercontent.com_rocks-moonscript-org_moonrocks-mirror_master": 权限不够
mkdir: 无法创建目录"/home/vera/.cache/luarocks/https___raw.githubusercontent.com_rocks-moonscript-org_moonrocks-mirror_master": 权限不够
mkdir: 无法创建目录"/home/vera/.cache/luarocks/https___raw.githubusercontent.com_rocks-moonscript-org_moonrocks-mirror_master": 权限不够
Warning: Failed searching manifest: Failed creating temporary cache directory /home/vera/.cache/luarocks/https___raw.githubusercontent.com_rocks-moonscript-org_moonrocks-mirror_master

So just go to the github, find the dependency it ask for.so loop.As you can see, here infact I just need rnn, nn, optim, torch, the other is all this dependency ask for.

Make sure the dependency is already installed in your dict.

luarocks list

Hope to help you . XD

like image 32
vera Avatar answered Oct 20 '22 16:10

vera


You should use the luarocks provided by torch.

Include ~/torch/install/bin in your $PATH as the first entry. You will then be able to use luarocks install without such problem.

For more information, please see the following link - https://github.com/torch/nngraph/issues/52

like image 2
Shane Huang Avatar answered Oct 20 '22 15:10

Shane Huang