I'm having a strange issue with selenium when building a standalone exe with pyinstaller. The program i'm packaging is utilising pyqt as well.
Everything runs fine when running the original python script, both in a virtual environment and without. Also, i can compile a fully functional version of my script with PyInstaller. The strange thing happens when compiling using a virtual environment:
selenium wont work anymore when i run the compiled executable. it gives me this error:
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities
i did some research and found this error has something to do with a browser version mismatch, if i understand correctly. adding some capabilities to the webdriver didnt help.. Note: Strangely, this error disappears when removing all pyqt related code from the class dealing with the webdriver (seems like pyqt is interfering here somehow) which is sadly not an option for me because i need qt stuff (specifically signals) in my class.
i dont understand how this is happening though, because i only have one version of firefox installed. so the virtual environment is using the same browser.
now i have two one questions:
- what could be the reason for recieving the above mentioned error? (I'd rather continue building with my virtual environment. If that turns out too hard to achieve, id like to optimise the non-virtual-environment build)
(- how can i get rid of the .so files included to the bundle? i tried solutions from here but none worked.
edit: the 2nd question has been resolved: i had misplaced the exclusion code in the .spec file. it should be right after the analysis part, not at the end of the file.)