Can't find files in exe PyInstaller










-1














I'm trying to make an exe file that uses the phantomjs exe and the chromedriver exe files in it and will have those files included in the python exe I'm making with PyInstaller. I'm not sure if the problem is that PyInstaller isn't adding the exes to the single exe being made or that the location of them isn't correct in the python file that uses them within the exe.



Here's the code for the bat file that makes the python exe:



 pyinstaller --noconfirm --log-level=WARN ^
--onefile --nowindow ^
--add-data="chromedriver.exe;."^
--add-data="phantomjs.exe;." ^
Grade_Submitter.py


Here's the code that is supposed to get the phantomjs exe in the main exe file



 driver = webdriver.PhantomJS("/phantomjs.exe")


I appreciate the help. I believe the main problem is accessing the files in the exe and my program not looking outside of the exe for the files. However, I'm not quite sure how to get it to retrieve the files from the exe. My program works if the files are in the same folder outside of the exe, but I need it to get everything working with only one file and not multiple.










share|improve this question























  • windows (.exe) uses (backslash) not / (forward slash), besides that you would be telling the code to look in the main OS roots directory! You want ` driver = webdriver.PhantomJS("phantomjs.exe")` if it's in the same directory or even use the full path?
    – Jack Herer
    Nov 11 at 9:55











  • Possible duplicate of Bundling data files with PyInstaller (--onefile)
    – stovfl
    Nov 11 at 12:28










  • No, I'm looking inside the exe for the file. I see what you mean with the backslash though. I tried using those too, but I still can't locate the files within the exe file. I looked at the above question thatis similar to mine too but it wasn't able to help me.
    – Kyle Henry
    Nov 11 at 20:49










  • Okay, so I found a possible solution with the above question, but everytime it gives me a permission error when driver = webdriver.PhantomJS("phantomjs.exe") tries to get the phantomjs.exe.
    – Kyle Henry
    Nov 12 at 3:30















-1














I'm trying to make an exe file that uses the phantomjs exe and the chromedriver exe files in it and will have those files included in the python exe I'm making with PyInstaller. I'm not sure if the problem is that PyInstaller isn't adding the exes to the single exe being made or that the location of them isn't correct in the python file that uses them within the exe.



Here's the code for the bat file that makes the python exe:



 pyinstaller --noconfirm --log-level=WARN ^
--onefile --nowindow ^
--add-data="chromedriver.exe;."^
--add-data="phantomjs.exe;." ^
Grade_Submitter.py


Here's the code that is supposed to get the phantomjs exe in the main exe file



 driver = webdriver.PhantomJS("/phantomjs.exe")


I appreciate the help. I believe the main problem is accessing the files in the exe and my program not looking outside of the exe for the files. However, I'm not quite sure how to get it to retrieve the files from the exe. My program works if the files are in the same folder outside of the exe, but I need it to get everything working with only one file and not multiple.










share|improve this question























  • windows (.exe) uses (backslash) not / (forward slash), besides that you would be telling the code to look in the main OS roots directory! You want ` driver = webdriver.PhantomJS("phantomjs.exe")` if it's in the same directory or even use the full path?
    – Jack Herer
    Nov 11 at 9:55











  • Possible duplicate of Bundling data files with PyInstaller (--onefile)
    – stovfl
    Nov 11 at 12:28










  • No, I'm looking inside the exe for the file. I see what you mean with the backslash though. I tried using those too, but I still can't locate the files within the exe file. I looked at the above question thatis similar to mine too but it wasn't able to help me.
    – Kyle Henry
    Nov 11 at 20:49










  • Okay, so I found a possible solution with the above question, but everytime it gives me a permission error when driver = webdriver.PhantomJS("phantomjs.exe") tries to get the phantomjs.exe.
    – Kyle Henry
    Nov 12 at 3:30













-1












-1








-1







I'm trying to make an exe file that uses the phantomjs exe and the chromedriver exe files in it and will have those files included in the python exe I'm making with PyInstaller. I'm not sure if the problem is that PyInstaller isn't adding the exes to the single exe being made or that the location of them isn't correct in the python file that uses them within the exe.



Here's the code for the bat file that makes the python exe:



 pyinstaller --noconfirm --log-level=WARN ^
--onefile --nowindow ^
--add-data="chromedriver.exe;."^
--add-data="phantomjs.exe;." ^
Grade_Submitter.py


Here's the code that is supposed to get the phantomjs exe in the main exe file



 driver = webdriver.PhantomJS("/phantomjs.exe")


I appreciate the help. I believe the main problem is accessing the files in the exe and my program not looking outside of the exe for the files. However, I'm not quite sure how to get it to retrieve the files from the exe. My program works if the files are in the same folder outside of the exe, but I need it to get everything working with only one file and not multiple.










share|improve this question















I'm trying to make an exe file that uses the phantomjs exe and the chromedriver exe files in it and will have those files included in the python exe I'm making with PyInstaller. I'm not sure if the problem is that PyInstaller isn't adding the exes to the single exe being made or that the location of them isn't correct in the python file that uses them within the exe.



Here's the code for the bat file that makes the python exe:



 pyinstaller --noconfirm --log-level=WARN ^
--onefile --nowindow ^
--add-data="chromedriver.exe;."^
--add-data="phantomjs.exe;." ^
Grade_Submitter.py


Here's the code that is supposed to get the phantomjs exe in the main exe file



 driver = webdriver.PhantomJS("/phantomjs.exe")


I appreciate the help. I believe the main problem is accessing the files in the exe and my program not looking outside of the exe for the files. However, I'm not quite sure how to get it to retrieve the files from the exe. My program works if the files are in the same folder outside of the exe, but I need it to get everything working with only one file and not multiple.







python pyinstaller






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 at 2:10

























asked Nov 11 at 5:54









Kyle Henry

14




14











  • windows (.exe) uses (backslash) not / (forward slash), besides that you would be telling the code to look in the main OS roots directory! You want ` driver = webdriver.PhantomJS("phantomjs.exe")` if it's in the same directory or even use the full path?
    – Jack Herer
    Nov 11 at 9:55











  • Possible duplicate of Bundling data files with PyInstaller (--onefile)
    – stovfl
    Nov 11 at 12:28










  • No, I'm looking inside the exe for the file. I see what you mean with the backslash though. I tried using those too, but I still can't locate the files within the exe file. I looked at the above question thatis similar to mine too but it wasn't able to help me.
    – Kyle Henry
    Nov 11 at 20:49










  • Okay, so I found a possible solution with the above question, but everytime it gives me a permission error when driver = webdriver.PhantomJS("phantomjs.exe") tries to get the phantomjs.exe.
    – Kyle Henry
    Nov 12 at 3:30
















  • windows (.exe) uses (backslash) not / (forward slash), besides that you would be telling the code to look in the main OS roots directory! You want ` driver = webdriver.PhantomJS("phantomjs.exe")` if it's in the same directory or even use the full path?
    – Jack Herer
    Nov 11 at 9:55











  • Possible duplicate of Bundling data files with PyInstaller (--onefile)
    – stovfl
    Nov 11 at 12:28










  • No, I'm looking inside the exe for the file. I see what you mean with the backslash though. I tried using those too, but I still can't locate the files within the exe file. I looked at the above question thatis similar to mine too but it wasn't able to help me.
    – Kyle Henry
    Nov 11 at 20:49










  • Okay, so I found a possible solution with the above question, but everytime it gives me a permission error when driver = webdriver.PhantomJS("phantomjs.exe") tries to get the phantomjs.exe.
    – Kyle Henry
    Nov 12 at 3:30















windows (.exe) uses (backslash) not / (forward slash), besides that you would be telling the code to look in the main OS roots directory! You want ` driver = webdriver.PhantomJS("phantomjs.exe")` if it's in the same directory or even use the full path?
– Jack Herer
Nov 11 at 9:55





windows (.exe) uses (backslash) not / (forward slash), besides that you would be telling the code to look in the main OS roots directory! You want ` driver = webdriver.PhantomJS("phantomjs.exe")` if it's in the same directory or even use the full path?
– Jack Herer
Nov 11 at 9:55













Possible duplicate of Bundling data files with PyInstaller (--onefile)
– stovfl
Nov 11 at 12:28




Possible duplicate of Bundling data files with PyInstaller (--onefile)
– stovfl
Nov 11 at 12:28












No, I'm looking inside the exe for the file. I see what you mean with the backslash though. I tried using those too, but I still can't locate the files within the exe file. I looked at the above question thatis similar to mine too but it wasn't able to help me.
– Kyle Henry
Nov 11 at 20:49




No, I'm looking inside the exe for the file. I see what you mean with the backslash though. I tried using those too, but I still can't locate the files within the exe file. I looked at the above question thatis similar to mine too but it wasn't able to help me.
– Kyle Henry
Nov 11 at 20:49












Okay, so I found a possible solution with the above question, but everytime it gives me a permission error when driver = webdriver.PhantomJS("phantomjs.exe") tries to get the phantomjs.exe.
– Kyle Henry
Nov 12 at 3:30




Okay, so I found a possible solution with the above question, but everytime it gives me a permission error when driver = webdriver.PhantomJS("phantomjs.exe") tries to get the phantomjs.exe.
– Kyle Henry
Nov 12 at 3:30












1 Answer
1






active

oldest

votes


















0














You guys were right, I didn't look at Bundling data files with PyInstaller enough. One of the given solutions worked for me. Also, the permission error I was given was just me adding the .exe files as data files and not binary files.






share|improve this answer




















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53246224%2fcant-find-files-in-exe-pyinstaller%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You guys were right, I didn't look at Bundling data files with PyInstaller enough. One of the given solutions worked for me. Also, the permission error I was given was just me adding the .exe files as data files and not binary files.






    share|improve this answer

























      0














      You guys were right, I didn't look at Bundling data files with PyInstaller enough. One of the given solutions worked for me. Also, the permission error I was given was just me adding the .exe files as data files and not binary files.






      share|improve this answer























        0












        0








        0






        You guys were right, I didn't look at Bundling data files with PyInstaller enough. One of the given solutions worked for me. Also, the permission error I was given was just me adding the .exe files as data files and not binary files.






        share|improve this answer












        You guys were right, I didn't look at Bundling data files with PyInstaller enough. One of the given solutions worked for me. Also, the permission error I was given was just me adding the .exe files as data files and not binary files.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 12 at 3:54









        Kyle Henry

        14




        14



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53246224%2fcant-find-files-in-exe-pyinstaller%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Darth Vader #20

            How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

            Ondo