Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Won't launch browser even when specified #10

Open
Jah-On opened this issue Dec 23, 2019 · 9 comments
Open

Won't launch browser even when specified #10

Jah-On opened this issue Dec 23, 2019 · 9 comments

Comments

@Jah-On
Copy link

Jah-On commented Dec 23, 2019

While on linux mint, the browser doesn't open when the match is started.

@tarehart
Copy link
Contributor

Thanks for reporting! We've never tested that functionality before, the only Linux support we vouch for is python, described at https://github.com/RLBot/RLBot/wiki/Operating-System-Support, and rust unofficially. I'll consider this a feature request 👍

@Jah-On
Copy link
Author

Jah-On commented Dec 24, 2019

Hey Tarehart,
I don't mind attempting to get it to run on Linux, but I would need to know where the command(s) are in the code. I went through the code but couldn't see anything regarding a web request command. (BTW) Good job with this project! Almost everything works to the point of playing against AIs on Linux! There are some kinks in the main RLBot program, but it's pretty good considering I'm not using WINE.

@tarehart
Copy link
Contributor

Thanks! Linux support was set up by @kipje13, he did a great job :)

This is the code you're probably thinking of: https://github.com/RLBot/RLBot/blob/master/src/main/python/rlbot/botmanager/scratch_manager.py#L118

There could easily be some stuff in there that's not properly cross-platform. You'll also see that Chrome is a requirement when using the spawn_browser setting.

@Jah-On
Copy link
Author

Jah-On commented Dec 24, 2019

OK, great news! After doing some testing, I discovered that the requirements.txt file doesn't actually do any required installs, which means that Python had missing dependencies. I made this .sh script to fill in all dependencies, including ones for the scratch-gui server.

sudo su apt-get install gcc apt-get install python-dev3.6 pip3 install psutil pip3 install inputs pip3 install PyQt5 pip3 install PyQt5-sip pip3 install py4j pip3 install websockets pip3 install dataclasses pip3 install colorama pip3 install crayons pip3 install configparser pip3 install webdriver-manager pip3 install rlbot pip3 install selenium pip3 install websockets pip3 install eel echo "Done!"

Then to keep my fellows penguins happy, I made this .sh script.
python3 run.py
and this one.
python3 run.py gui

There is another bug that I'll make a separate report for.

@Jah-On Jah-On closed this as completed Dec 24, 2019
@kipje13
Copy link

kipje13 commented Dec 24, 2019

python3 run.py should be all that is needed to install the dependencies, I am glad you got it working but I do not consider this as fixed yet.

@kipje13 kipje13 reopened this Dec 24, 2019
@Jah-On
Copy link
Author

Jah-On commented Dec 25, 2019

OK, I added some things to the run.py file that will automatically run install/updates. It should be universal, since it uses pip, but the Windows way will still be there should it not work.

Hope that works for everyone!
`import sys
import os

cmd = "pip3 install websockets"
returned_value = os.system(cmd)
cmd = "pip3 install selenium"
returned_value = os.system(cmd)
cmd = "pip3 install webdriver_manager"
returned_value = os.system(cmd)
cmd = "pip3 install pip"
returned_value = os.system(cmd)
cmd = "pip3 install rlbot"
returned_value = os.system(cmd)

https://stackoverflow.com/a/51704613

try:
from pip import main as pipmain
except ImportError:
from pip._internal import main as pipmain

More pip changes breaking us.

main_fn = pipmain
if hasattr(pipmain, 'main'):
main_fn = pipmain.main

DEFAULT_LOGGER = 'rlbot'

if name == 'main':

try:
    from rlbot.utils import public_utils, logging_utils

    logger = logging_utils.get_logger(DEFAULT_LOGGER)
    if not public_utils.have_internet():
        logger.log(logging_utils.logging_level,
                   'Skipping upgrade check for now since it looks like you have no internet')
    elif public_utils.is_safe_to_upgrade():
        main_fn(['install', '-r', 'requirements.txt', '--upgrade', '--upgrade-strategy=eager'])

        # https://stackoverflow.com/a/44401013
        rlbots = [module for module in sys.modules if module.startswith('rlbot')]
        for rlbot_module in rlbots:
            sys.modules.pop(rlbot_module)

except ImportError:
    main_fn(['install', '-r', 'requirements.txt', '--upgrade', '--upgrade-strategy=eager'])

try:
    if len(sys.argv) > 1 and sys.argv[1] == 'gui':
        from rlbot.gui.qt_root import RLBotQTGui

        RLBotQTGui.main()
    else:
        from rlbot import runner

        runner.main()
except Exception as e:
    print("Encountered exception: ", e)
    print("Press enter to close.")
    input()`

@Jah-On
Copy link
Author

Jah-On commented Dec 25, 2019

LOL, I can't make it look right.

@kipje13
Copy link

kipje13 commented Dec 25, 2019

I am not able to reproduce this, python3 run.py installs the dependencies for me.

@tarehart we might want to change our approach of how we call pip from python because our current method is not officially supported. See https://stackoverflow.com/a/50255019

@Jah-On
Copy link
Author

Jah-On commented Dec 25, 2019

@kipje13 On Linux Mint? Hmm. Well, I think putting pip in the py file will make it more universal anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants