How to install libraries?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
arquech
Prole
Posts: 2
Joined: Thu Apr 02, 2020 4:42 pm

How to install libraries?

Post by arquech »

help, how can I install a library in love2d and lua? I've been searching for days and can't find how to install the "push" library :c
User avatar
CogentInvalid
Prole
Posts: 27
Joined: Sat Dec 14, 2013 12:15 am

Re: How to install libraries?

Post by CogentInvalid »

Put push.lua in your game's main folder and call

Code: Select all

push = require "push"
in your code.
carcinocron
Prole
Posts: 1
Joined: Sat Jun 25, 2022 5:55 pm

Re: How to install libraries?

Post by carcinocron »

I'm trying to install literally any package, but a file that is just `push = require "push"` returns for me the following error:

Code: Select all

Error: main.lua:1: module 'push' not found:
	no field package.preload['push']
	no 'push' in LOVE game directories.
	no file 'push' in LOVE paths.
	no file './push.lua'
	no file '/usr/share/luajit-2.1.0-beta3/push.lua'
	no file '/usr/local/share/lua/5.1/push.lua'
	no file '/usr/local/share/lua/5.1/push/init.lua'
	no file '/usr/share/lua/5.1/push.lua'
	no file '/usr/share/lua/5.1/push/init.lua'
	no file './push.so'
	no file '/usr/local/lib/lua/5.1/push.so'
	no file '/usr/lib/x86_64-linux-gnu/lua/5.1/push.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
	[love "boot.lua"]:345: in function <[love "boot.lua"]:341>
	[C]: in function 'require'
	main.lua:1: in main chunk
	[C]: in function 'require'
	[love "boot.lua"]:316: in function <[love "boot.lua"]:126>
	[C]: in function 'xpcall'
	[love "boot.lua"]:355: in function <[love "boot.lua"]:348>
	[C]: in function 'xpcall'
and this is the first result on google for "love2d installing libraries"
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: How to install libraries?

Post by pgimeno »

Have you tried to put push.lua in your game's main folder as CogentInvalid said?
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 43 guests