'pyinstaller seems to need different paths under Microsoft Windows for compiling
in short: if I start my script in Atom I need to specify different paths than when I want to compile it with pyinstaller.
This is quite troublesome, I think I make a mistake that could be avoided. I tried around and googled, but no success so far. Maybe you can assist me here :)
Compiling:
pyinstaller Testscript.py --onefile --noconsole --collect-data selenium
Different Codes are explained with Comments behind
#window.iconbitmap(r'.\test.ico') # Used for creating exe
window.iconbitmap(r'C:\Users\XXX\Desktop\Bot\test.ico') # Used for running in Atom
#s = Service(r'.\chromedriver.exe') # needed for creating exe file!
s = Service(r'C:\Users\XXX\Desktop\Bot\chromedriver.exe') # Used for running in Atom
I hope you could follow me so far. If I use the following Compiling code with the following lines in Atom, then it's compiling, but not working.
window.iconbitmap(r'.\test.ico') # Used for creating exe
s = Service(r'.\chromedriver.exe') # needed for creating exe file!
pyinstaller Testscript.py --onefile --noconsole --collect-data selenium --add-binary ".\chromedriver.exe;.\driver" --icon=".\test.ico"
The Chromedriver cannot be found and the icon cannot be found too.
So I am actually asking for 2 solutions at once:
- Solution: How to put the path in Atom correctly, so I can run the script in Atom and compile it at the same time without changing it?
- Solution: How can I use the pyinstaller properly to include chromedriver and the icon correctly in the compiled .exe file and it is working properly? I guess the path in Atom needs correction too.
I am at windows using Atom as my editor and pyinstaller with CMD for compiling. All solutions I found so far were for Linux :(
Please help. Thanks :)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
