Problem using torch library on Windows:
SciTE:
lua: init.lua:12: module 'paths' not found:
no field package.preload['paths']
no file '.\paths.lua'
no file 'C:\Program Files (x86)\Lua\5.1\lua\paths.lua'
no file 'C:\Program Files (x86)\Lua\5.1\lua\paths\init.lua'
no file 'C:\Program Files (x86)\Lua\5.1\paths.lua'
no file 'C:\Program Files (x86)\Lua\5.1\paths\init.lua'
no file 'C:\Program Files (x86)\Lua\5.1\lua\paths.luac'
no file '.\paths.dll'
no file '.\paths51.dll'
no file 'C:\Program Files (x86)\Lua\5.1\paths.dll'
no file 'C:\Program Files (x86)\Lua\5.1\paths51.dll'
no file 'C:\Program Files (x86)\Lua\5.1\clibs\paths.dll'
no file 'C:\Program Files (x86)\Lua\5.1\clibs\paths51.dll'
no file 'C:\Program Files (x86)\Lua\5.1\loadall.dll'
no file 'C:\Program Files (x86)\Lua\5.1\clibs\loadall.dll'
stack traceback:
[C]: in function 'require'
init.lua:12: in main chunk
[C]: ?
Exit code: 1
do not write about Linux, I saw: Torch test.sh, /usr/bin/lua: module 'paths' not found
Does anyone have file: paths.lua?
I also got this same error I find a solution from stackoverflow.
By Adding. /torch/install/bin/torch-activate
in your bashrc file and makes the test.sh script run.
Related
I am trying to implement a library which is a Github project on 3D reconstruction using a single image in Ubuntu 16.04. I have installed all dependencies. I have checked if each dependency is correctly installed with help from Google searches and stackoverflow.
But, when I am executing the ./run.sh as mentioned in the Github page, I get the following error.
/home/username/torch/install/bin/luajit: /home/username/torch/install/share/lua/5.1/trepl/init.lua:389: /home/username/torch/install/share/lua/5.1/trepl/init.lua:389: module 'fb.python' not found:No LuaRocks module found for fb.python
no field package.preload['fb.python']
no file '/home/username/.luarocks/share/lua/5.1/fb/python.lua'
no file '/home/username/.luarocks/share/lua/5.1/fb/python/init.lua'
no file '/home/username/torch/install/share/lua/5.1/fb/python.lua'
no file '/home/username/torch/install/share/lua/5.1/fb/python/init.lua'
no file './fb/python.lua'
no file '/home/username/torch/install/share/luajit-2.1.0-beta1/fb/python.lua'
no file '/usr/local/share/lua/5.1/fb/python.lua'
no file '/usr/local/share/lua/5.1/fb/python/init.lua'
no file '/home/username/.luarocks/lib/lua/5.1/fb/python.so'
no file '/home/username/torch/install/lib/lua/5.1/fb/python.so'
no file '/home/username/torch/install/lib/fb/python.so'
no file './fb/python.so'
no file '/usr/local/lib/lua/5.1/fb/python.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file '/home/username/.luarocks/lib/lua/5.1/fb.so'
no file '/home/username/torch/install/lib/lua/5.1/fb.so'
no file '/home/username/torch/install/lib/fb.so'
no file './fb.so'
no file '/usr/local/lib/lua/5.1/fb.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'error'
/home/username/torch/install/share/lua/5.1/trepl/init.lua:389: in function 'require'
main.lua:8: in main chunk
[C]: in function 'dofile'
...name/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00405d50
ls: cannot access '*.txt': No such file or directory
This issue is in Torch directory and not in the project.
So please guide me how I can resolve it or what could have gone wrong.
P.S. I am new to Linux.
You need to install Torch first. th and luarocks both commands will be available after you install Torch, see Torch
I'm using Eclipsse Lua Development Tools to develop Lua aplication but I'm getting an error. I need to add the module Lua Sockets to the Eclipse Lua and when I compile the aplication in the console I'm getting the following error:
Exception in thread "main" com.naef.jnlua.LuaRuntimeException: ...eclipse_lua\workspace\sockets\src\sockets\socket.lua:13: module 'socket.core' not found:
no field package.preload['socket.core']
no file '.\socket\core.lua'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\lua\socket\core.lua'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\lua\socket\core\init.lua'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\socket\core.lua'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\socket\core\init.lua'
no file 'C:\eclipse_lua\workspace\sockets\src\socket\core.lua'
no file 'C:\eclipse_lua\workspace\sockets\src\socket\core\init.lua'
no file 'C:\eclipse_lua\workspace\sockets\src\socket\core.luac'
no file 'C:\eclipse_lua\workspace\sockets\src\socket\core\init.luac'
no file 'C:\eclipse_lua\workspace\sockets\src\sockets\socket\core.lua'
no file 'C:\eclipse_lua\workspace\sockets\src\sockets\socket\core\init.lua'
no file 'C:\eclipse_lua\workspace\sockets\src\sockets\socket\core.luac'
no file 'C:\eclipse_lua\workspace\sockets\src\sockets\socket\core\init.luac'
no file '.\socket\core.dll'
no file '.\socket\core51.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\socket\core.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\socket\core51.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\clibs\socket\core.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\clibs\socket\core51.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\loadall.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\clibs\loadall.dll'
no file '.\socket.dll'
no file '.\socket51.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\socket.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\socket51.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\clibs\socket.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\clibs\socket51.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\loadall.dll'
no file 'C:\Program Files\Java\jre1.8.0_121\bin\clibs\loadall.dll'
at com.naef.jnlua.LuaState.lua_pcall(Native Method)
at com.naef.jnlua.LuaState.call(LuaState.java:555)
at org.eclipse.ldt.support.lua51.internal.interpreter.JNLua51Launcher.run(JNLua51Launcher.java:128)
at org.eclipse.ldt.support.lua51.internal.interpreter.JNLua51Launcher.main(JNLua51Launcher.java:143)
I've downloaded the module scokets in the official lua web page and added this module to the Lua Eclipse. I'm using lua 5.1 in the Eclipse with lua socket 2.0.2 (luasocket-2.0.2-lua-5.1.2-Win32-vc8).
I don't understand what I need to do to solve this error.
Thank you very much
I am call lua in C++ applications. I have several lua files to call, like RunAPI_1208.lua , JSON.lua, etc. All the lua file is called by main.lua. While in C++ , I run all the file and finally run main.lua. I met this problem. I am using Cocos2d-x 2.2.6. How can I solve it?
[string "Main.lua"]:9: module 'RunAPI_1208' not found:
no field package.preload['RunAPI_1208']
no file './RunAPI_1208.lua'
no file '/usr/local/share/lua/5.1/RunAPI_1208.lua'
no file '/usr/local/share/lua/5.1/RunAPI_1208/init.lua'
no file '/usr/local/lib/lua/5.1/RunAPI_1208.lua'
no file '/usr/local/lib/lua/5.1/RunAPI_1208/init.lua'
no file './RunAPI_1208.so'
no file '/usr/local/lib/lua/5.1/RunAPI_1208.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
Cocos2d: [string "Main.lua"]:9: module 'RunAPI_1208' not found:
no field package.preload['RunAPI_1208']
no file './RunAPI_1208.lua'
no file '/usr/local/share/lua/5.1/RunAPI_1208.lua'
no file '/usr/local/share/lua/5.1/RunAPI_1208/init.lua'
no file '/usr/local/lib/lua/5.1/RunAPI_1208.lua'
no file '/usr/local/lib/lua/5.1/RunAPI_1208/init.lua'
no file './RunAPI_1208.so'
no file '/usr/local/lib/lua/5.1/RunAPI_1208.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
And this is my main.lua:
local run = require("RunAPI_1208")
I have tried everything but still can not require file in Lua. I am using LuaEdit 2010 on Windows 8.1
Relative path is still not working. I used these commands, which i have found but I still get the error below. My file is C:\Lua\file.lua, but I need to use relative path.
package.path = package.path .. ";../?.lua"
require ("file.lua") --also require ("file")
My error is:
Runtime Error at line -1: c:\lua\diplomka4.lua:S3: module 'file' not
found:
no field package.preload['file']
no file '.\file.lua'
no file 'C:\Program Files (x86)\LuaEdit 2010\lua\file.lua'
no file 'C:\Program Files (x86)\LuaEdit 2010\lua\file\init.lua'
no file 'C:\Program Files (x86)\LuaEdit 2010\file.lua‘
no file 'C:\Program Files (x86)\LuaEdit 2010\file\init.lua'
no file 'C:\Program Files (x86)\Lua\5.1\lua\file.luac'
no file '../file.lua'
no file '.\file.dll'
no file 'C:\Program Files (x86)\LuaEdit 2010\file.dll'
no file 'C:\Program Files (x86)\LuaEdit 2010\loadall.dll'
I'm quite new to Lua and I have some problems with the import mechanism.
From other languages I'm used to do something like this:
include "./lib/mylib.h"
or in general just to pass the local path to the file I would like to include.
Now in Lua it is a bit confusing to me. I read something about that require looks for the library in the lua path.
In my case I would like to create a script that uses the luasocket library but I would like to import it from a local path so that I can deploy it without the need to have it on another machine in the lua path.
From other forums I got solutions like creating a local require function that looks in a given local library folder but that didn't work.
Then I read that I can just type require 'myfile' to import a different file locally but luasocket requires a core.dll and if I just move the lua files of the library to my local path it can't find the dll.
Is there an easy way to solve this. What do I have to do to get this working?
It is sufficient for the .dll extension to be in the LUA_CPATH (so it ends up in package.cpath). For example, put the socket.lua in C:\Foo, and put core.dll in same folder. Then require 'socket' will fail:
> print(package.cpath)
.\?.dll;.\?51.dll;C:\Program Files\Lua\5.1\?.dll;C:\Program Files\Lua\5.1\?51.dl
l;C:\Program Files\Lua\5.1\clibs\?.dll;C:\Program Files\Lua\5.1\clibs\?51.dll;C:
\Program Files\Lua\5.1\loadall.dll;C:\Program Files\Lua\5.1\clibs\loadall.dll
> print(package.path)
;.\?.lua;C:\Program Files\Lua\5.1\lua\?.lua;C:\Program Files\Lua\5.1\lua\?\init.
lua;C:\Program Files\Lua\5.1\?.lua;C:\Program Files\Lua\5.1\?\init.lua;C:\Progra
m Files\Lua\5.1\lua\?.luac
> require 'socket'
.\socket.lua:13: module 'socket.core' not found:
-- look for preload
no field package.preload['socket.core']
-- look for .lua in socket folder anywhere on package.path:
no file '.\socket\core.lua'
no file 'C:\Program Files\Lua\5.1\lua\socket\core.lua'
no file 'C:\Program Files\Lua\5.1\lua\socket\core\init.lua'
...
-- look for .luac in socket folder anywhere on package.path:
no file 'C:\Program Files\Lua\5.1\lua\socket\core.luac'
-- look for .dll in socket folder anywhere on package.cpath:
no file '.\socket\core.dll'
no file '.\socket\core51.dll'
no file 'C:\Program Files\Lua\5.1\socket\core.dll'
no file 'C:\Program Files\Lua\5.1\socket\core51.dll'
no file 'C:\Program Files\Lua\5.1\clibs\socket\core.dll'
no file 'C:\Program Files\Lua\5.1\clibs\socket\core51.dll'
...
stack traceback:
[C]: in function 'require'
.\socket.lua:13: in main chunk
[C]: in function 'require'
stdin:1: in main chunk
[C]: ?
because socket.lua requires socket.core, so Lua interpreter looks for core.lua in a "socket" folder anywhere on package.path, doesn't find it (socket folder doesnt' exist), then looks for core.dll in socket folder anywhere on package.cpath, same problem.
Now create C:\Foo\socket folder, and move core.dll to it, then require 'socket' will work (from interpreter started while cd to C:\Foo).
In your case, if you have yourLuaScript.lua in C:\Foo, you could have socket.lua in same folder, core.dll in C:\Foo\socket, and yourLuaScript.lua could require 'socket' and, as long as package.path contains .\*.lua, and package.cpath contains .\*.dll, you will be able to run yourLuaScript.lua.