Ask coding questions

← Back to all posts
Webbot not working
h
Coder100 (17045)

So, with Polygott, I ran the command:

pip3 install webbot

which worked fine.

[insert install prompt]

However, in index.py
when I ran

"""
...
...
...
...
...
...
"""
import webbot
web = webbot.Browser()
web.go_to("https://repl.it")
while True:
  print(input("Finished."))

It said module webbot is not found :(
Can someone please tell me what when wrong? Thanks!

Answered by Giothecoder (135) [earned 5 cycles]
View Answer
Comments
hotnewtop
Giothecoder (135)

It isn’t a permanent install because security, so you’ll have to install it every time

Coder100 (17045)

What do you mean by that? How can I fix it then? @Giothecoder

Coder100 (17045)

I could do the same for express with node.js, so what's the exception with python? @Giothecoder

Giothecoder (135)

@Coder100 there isn’t one, the same would happen for node packages. All you have to do is make sure to install the packages each time. So now instead of installing it once, just install it every time so instead of having
python index.py
It’ll be
pip3 install webbot ; python index.py

If you can figure out how to check for you dependencies, do it - it’s really the only way of doing this efficiently, but otherwise just install everything every time instead,

Coder100 (17045)

Oh, I see why the node.js works: I have a package.json that specifies express, so do you know a way that is the same with python? @Giothecoder

Giothecoder (135)

@Coder100 yes I think, you use a requirements.txt file with just a list of the pkgs

Coder100 (17045)

Ok, this is so annoying ugh I can get colored, but not webbot argh @Giothecoder

Giothecoder (135)

@Coder100 I don’t think so, it actually looks like it doesn’t work for colored because when I run it it says it can’t find a module named colored

Coder100 (17045)

Huh, weird it worked for me @Giothecoder

Giothecoder (135)

@Coder100 really? What error are you getting? This is a strange situation lol

Coder100 (17045)

I'm not getting an error, I just see orange hello world message (sort of unexpected since background is supposed to be yellow, but I guess that's just a terminal thing) @Giothecoder

Giothecoder (135)

Is that supposed to happen? @Coder100

Coder100 (17045)

Yeah pretty sure, I tested it before on a python project and that was the same result @Giothecoder

Giothecoder (135)

@Coder100 oh ok, so what the problem then again? Little confused now lol

Coder100 (17045)

Things that open up application windows like webbot and py game don't want to work however terminal things like colored do work makes since that's kind of confusing lol I'll try flask now @Giothecoder

Coder100 (17045)

Flask doesn't work either :( @Giothecoder

Giothecoder (135)

Darnnn what is this blech @Coder100

Coder100 (17045)

IKR I'll dm the devs on discord, maybe it's just a bug lol @Giothecoder

Giothecoder (135)

@Coder100 maybe... what if you tried transferring the code to a pygame repl and using pygame and just configuring the run button?

Giothecoder (135)

@Coder100 🤞 fingers crossed hope that helps.

Coder100 (17045)

It works! However I don't know what to do next @Giothecoder

Giothecoder (135)

@Coder100 what do you mean? For what?

Coder100 (17045)

For transferring the successful test to polygott @Giothecoder

Giothecoder (135)

@Coder100 um. Quick question why are you using a polygott repl? You may not necessarily need it.

Coder100 (17045)

I would use it for node.js puppeteer until repl.it makes a way to do so otherwise @Giothecoder

Giothecoder (135)

@Coder100 there is another way. Just configure the run button with a .replit file

Giothecoder (135)

@Coder100 you make a file called .replit, and then in that file you put
run="commands" where commands are the things you want the repl to do when you click run. An example would be some thing like

main.py

print("hello world");

.replit

run="python main.py"

Edit: the commands are just bash commands, it’s the same exact range of function as the polygott repl for which you were using it.

Giothecoder (135)

@Coder100 cool. Should work now lol.

Coder100 (17045)

Thanks! Any way to add more lines? @Giothecoder

Giothecoder (135)

@Coder100 yeah, just put a semicolon like you would in bash:
node index.js ; python main.py ; echo done

AdCharity (1317)

if giothecoder answered it mark him right...