P
P
Python Newbie2021-09-16 17:51:31
Python
Python Newbie, 2021-09-16 17:51:31

Problem compiling python script with selenium. What to do?

I have a code. But after compiling: pyinstaller main.pe --onefileand running I get an error stating that such a module does not exist. Here is the import: Why is this and how to fix it? from selenium import webdriver

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Karbivnichy, 2021-09-16
@hottabxp

Any code more complicated than Hello World packaged with pyinstaller will bring +100500 problems - that's a fact! If you are a beginner, then there is no need for you to use pyinstaller and package your scripts in archives. If you want a properly working executable - use the right tools - C/C++, C#, Assembler...
Don't expect magic from pyinstaller.
And if you are still using selenium in the script, then this is generally nonsense (unless, of course, you are running this exe on your PC). After all, selenium requires a webdriver and a browser of the same version. And how do you know which browser and which version another person has. Moreover, on another computer, you need to copy the webdriver to the Windows folder or add the webdriver to PATH.
In short, get the following out of your head - Python + exe + pyinstaller.
PS: I just checked on Windows 7 - pyinstaller main.py --onefile- everything works, only you need to move the webdriver to the Windows folder.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question