User Controls

Python dependencies question.

  1. #1
    Sophie Pedophile Tech Support
    Just a quick question for today, say i have a python program that i wrote for Windows and within that Python program i use Selenium to have Mozilla Geckodriver do some stuff. I take it i will have to ship the Geckodriver with the compiled binary if i'd want to distribute my program right? I can't pack it all into one exe, except maybe as an MSI installer?
  2. #2
    Lanny Bird of Courage
    it should be doable to package geckodriver in the generated executable. You might need to copy it to some tempdir so you can point selenium to it. Are you using pyinstaller or py2exe?
  3. #3
    Sophie Pedophile Tech Support
    Originally posted by Lanny it should be doable to package geckodriver in the generated executable. You might need to copy it to some tempdir so you can point selenium to it. Are you using pyinstaller or py2exe?

    I am using pyinstaller.
  4. #4
    Lanny Bird of Courage
    Ok, add the path to geckodriver in the `binaries` option to Analysis in your specfile. Then it will be in the directory structure under the path in `sys._MEIPASS`. You'll want to read this:

    https://pythonhosted.org/PyInstaller/runtime-information.html#run-time-information

    for more info on accessing bundled files at runtime, it will work differently during dev (when you're not packaging) vs. in distribution so you'll need to use the check mentioned at the top of that page.

    Post last edited by Lanny at 2017-09-17T04:00:31.329672+00:00
    The following users say it would be alright if the author of this post didn't die in a fire!
  5. #5
    Sophie Pedophile Tech Support
    Originally posted by Lanny Ok, add the pack to geckodriver in the `binaries` option to Analysis in your specfile. Then access it will be in the directory structure under the path in `sys._MEIPASS`. You'll want to read this:

    https://pythonhosted.org/PyInstaller/runtime-information.html#run-time-information

    for more info on accessing bundled files at runtime, it will work differently during dev (when you're not packaging) vs. in distribution so you'll need to use the check mentioned at the top of that page.

    Thanks for the link. I'mma read that, if i run into any issues that i can't solve i'll post in this thread but i think it'll be good.
Jump to Top