Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Falkyraizu
Prole
Posts: 10
Joined: Sun Mar 22, 2020 9:30 pm

Hey, quick question. How do I fix the error:
I was following the CS50 course when it has a line that said:

Code: Select all

push = require 'push'

I type this code in, and my program stops working with a bunch of errors with messages such as "push not found", "no file push in love paths", etc. How do I fix this?

papainoel14
Prole
Posts: 10
Joined: Fri Mar 13, 2020 3:59 pm

he was probably importing a library.
Can you tell what the push is for?
I recommend taking a look at the libraries he is using in the project.

@edit
I was able to find this one: https://github.com/Ulydev/push
Last edited by papainoel14 on Mon Mar 23, 2020 2:16 am, edited 3 times in total.
Ninguem

Varkas
Prole
Posts: 32
Joined: Mon Mar 09, 2020 2:26 pm

Here is a description of what "require" does:

https://www.lua.org/pil/8.1.html

So to fix your error, either make sure a file "push" or "push.lua" is present in the search path, or change the path to include the location of the file.
In soviet russia, code debugs you.

Falkyraizu
Prole
Posts: 10
Joined: Sun Mar 22, 2020 9:30 pm

papainoel14 wrote:
Sun Mar 22, 2020 10:46 pm
he was probably importing a library.
Can you tell what the push is for?
I recommend taking a look at the libraries he is using in the project.

@edit
I was able to find this one: https://github.com/Ulydev/push
try to require it
I was going off the assumption that 'push' is a default package that is usable. The tutorial said nothing about "installing the push library" so I was assuming that it was there by default. Do I have to install push, because it seems as many games uses the push library, and none of them had to import it manually.

zorg
Party member
Posts: 2801
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Falkyraizu wrote:
Mon Mar 23, 2020 12:15 am
papainoel14 wrote:
Sun Mar 22, 2020 10:46 pm
he was probably importing a library.
Can you tell what the push is for?
I recommend taking a look at the libraries he is using in the project.

@edit
I was able to find this one: https://github.com/Ulydev/push
try to require it
I was going off the assumption that 'push' is a default package that is usable. The tutorial said nothing about "installing the push library" so I was assuming that it was there by default. Do I have to install push, because it seems as many games uses the push library, and none of them had to import it manually.
What CS50 course are we talking about exactly?
And no, there are no default packages included with löve that aren't the modules you can find on the wiki (utf-8, socket and (lua-)enet notwithstanding); everything else is a library you need to include.

And no, many games also had to import it manually.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

Falkyraizu
Prole
Posts: 10
Joined: Sun Mar 22, 2020 9:30 pm

zorg wrote:
Mon Mar 23, 2020 12:24 am
Falkyraizu wrote:
Mon Mar 23, 2020 12:15 am
papainoel14 wrote:
Sun Mar 22, 2020 10:46 pm
he was probably importing a library.
Can you tell what the push is for?
I recommend taking a look at the libraries he is using in the project.

@edit
I was able to find this one: https://github.com/Ulydev/push
try to require it
I was going off the assumption that 'push' is a default package that is usable. The tutorial said nothing about "installing the push library" so I was assuming that it was there by default. Do I have to install push, because it seems as many games uses the push library, and none of them had to import it manually.
What CS50 course are we talking about exactly?
And no, there are no default packages included with löve that aren't the modules you can find on the wiki (utf-8, socket and (lua-)enet notwithstanding); everything else is a library you need to include.

And no, many games also had to import it manually.
(if your interested start watching at 22:15)
Anyways, thanks for the explaination. It all makes sense now. I have to download the modules before using the 'require' command. Thanks for your help! I will tell you if anything goes wrong.

Falkyraizu
Prole
Posts: 10
Joined: Sun Mar 22, 2020 9:30 pm

[Content Deleted]
Last edited by Falkyraizu on Mon Mar 23, 2020 4:12 am, edited 1 time in total.

Falkyraizu
Prole
Posts: 10
Joined: Sun Mar 22, 2020 9:30 pm

[Content Deleted]

arquech
Prole
Posts: 2
Joined: Thu Apr 02, 2020 4:42 pm