Lua 的 PYTHONPATH 对应项是什么?

What is PYTHONPATH counterpart for Lua?

我喜欢让我自​​己的一些 classes 在 Torch7 的系统范围内可用。在 python 中,将 class 文件路径提供给 PYTHONPATH 环境变量就足够了。 Lua 是否有任何相同的方法?

您要找的环境变量是LUA_PATH

At start-up, Lua initializes this [package.path] variable with the value of the environment variable LUA_PATH_5_3 or the environment variable LUA_PATH or with a default path defined in luaconf.h, if those environment variables are not defined. Any ";;" in the value of the environment variable is replaced by the default path.

例如,要让 Lua 在 /home/bob/lualibs 中查找文件,您可以将 LUA_PATH 设置为 /home/bob/lualibs;;