Can't find files in exe PyInstaller
up vote
-1
down vote
favorite
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
add a comment |
up vote
-1
down vote
favorite
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
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 whendriver = webdriver.PhantomJS("phantomjs.exe")
tries to get the phantomjs.exe.
– Kyle Henry
Nov 12 at 3:30
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
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
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
python pyinstaller
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 whendriver = webdriver.PhantomJS("phantomjs.exe")
tries to get the phantomjs.exe.
– Kyle Henry
Nov 12 at 3:30
add a comment |
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 whendriver = 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
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
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.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
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.
add a comment |
up vote
0
down vote
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.
add a comment |
up vote
0
down vote
up vote
0
down vote
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.
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.
answered Nov 12 at 3:54
Kyle Henry
14
14
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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