← 输入框|github.com|刷新
Skip to content

Call pip with the subprocess module. - #31

Merged
kipje13 merged 1 commit into
RLBot:masterfrom
kipje13:master
Dec 26, 2019
Merged

kipje13 merged 1 commit into
RLBot:masterfrom
kipje13:master

Conversation

@kipje13

@kipje13 kipje13 commented Dec 26, 2019

Copy link
Copy Markdown
Contributor

Pip is not supposed to be imported. The recommended method is to call pip as a subprocess, see https://pip.pypa.io/en/latest/user_guide/#using-pip-from-your-program

I have decided to use subprocess.call over subprocess.check_call because the latter throws an exception when a package fails to install. The rlbottraining package fails to install if the python version is below 3.7 but is not required to succesfully run rlbot.

@tarehart

Copy link
Copy Markdown
Contributor

This will make things more robust, great! I typed up a long concern about finding the wrong pip on the system path, but then I finally noticed you're using sys.executable, "-m", "pip", that's clever :)

Because of that, I'm sure this will work even for people on Linux/Mac who run python3 run.py so I'm happy.

@kipje13
kipje13 merged commit 9d62b22 into RLBot:master Dec 26, 2019
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

Successfully merging this pull request may close these issues.

2 participants