错误:在Ubuntu上没有匹配luarocks查询的结果

我完全是Lua新手。这是我在新的虚拟Ubuntu上所做的。首先,我从官方网站下载了lua-5.3.4。

make linux
make install

这是依赖库的README.md建议我这样做。

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

但是,无论我在哪里使用它们,它始终返回此错误消息。

错误:没有匹配查询的结果。

因此,我按照在此处找到的建议从http://torch.ch/docs/getting-started.html安装火炬

这是我所做的

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

所有这些命令都是在我的计数下执行的

vera@ubuntu:~/Documents/relation inference$

然后我再次尝试安装依赖项,但再次失败。

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

我通过sudo su切换到root计数。然后,当我再次执行luarocks install nn时,我得到了这个:

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: 没有那个文件或目录(这意味着:没有该文件或该字典)
compilation terminated.

Error: Build error: Failed compiling object lnn.o

当我在root下使用其他命令时,我仍然得到相同的错误消息。

root@ubuntu:/home/vera/Documents/relation inference# luarocks install rnn
Error:没有匹配查询结果。

root@ubuntu:/home/vera/Documents/relation inference# luarocks install torch
Error:没有匹配查询结果。

root@ubuntu:/home/vera/Documents/relation inference#  luarocks install torch7-master
Error:没有匹配查询结果。

我已经从GitHub下载了依赖项。

点赞
用户7660573
用户7660573

最终我通过以下方法解决了我的问题。

Error: No results matching query were found. for luarocks in ubuntu,你可以在我的博客上找到解决方案的详细信息。

以下是我的做法。


首先,我发现我实际上并没有安装 Torch,尽管我按照官方网站的指示进行了三次安装。(我仍然不知道为什么。)你可以通过 th 命令来检测是否成功安装了 Torch。

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

然后, 你可能仍然会发现命令 luarocks install xxx 无效。接下来。

这是我最终发现有用的解决方案(这是中文的。如果你不明白,你可以看我写下的内容)。

在 Github 上下载所有的依赖项,解压并进入文件夹。

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

最重要的一点是你需要找到 .rockspec 的位置。

以下是一些依赖项的位置。你可能会发现它们并不总是以同样的格式。

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

在安装过程中,你可能会得到以下提示。

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

所以,只需转到 Github,找到它要求的依赖项所需的依赖项,循环进行。正如你所看到的,实际上在这里我只需要 rnn, nn, optim, torch,其他的都是此依赖项所要求的。

确保依赖项已经安装在你的文件夹中。

luarocks list

希望能帮助到你。XD

2017-03-05 14:35:11
用户3189466
用户3189466

要解决它,请按照以下步骤:

sudo apt install luarocks
sudo ~/torch/install/bin/luarocks install nn
2017-07-26 10:39:26
用户9092353
用户9092353

你应该使用 torch 提供的 luarocks。

~/torch/install/bin 加入你的 $PATH 作为第一个条目。 这样你就可以使用 luarocks install,而不会出现这样的问题。

更多信息,请参阅以下链接 - https://github.com/torch/nngraph/issues/52

2017-12-13 06:27:50