When running any code in sublime, pycharm or spyder I always get this message and the code stops. Code I'm currently using: https://i.sstatic.net/gNjci.jpg
RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable..
When adding if name == 'main': in front of the code it crashes:https://i.sstatic.net/wTMNg.jpg
But when I run the same code in python cmd it works just fine: https://i.sstatic.net/WYOUy.jpg
I have a 5 5600g apu and python 3.10 if that helps
Any help would be greatly appreciated, Thanks in advance
[Edit]I saw your video and your code doesn't crash, the process just ends. You can just add sleep to see the browser work.
This worked for me:
from multiprocessing import freeze_support
from time import sleep
if __name__ == '__main__':
freeze_support()
import undetected_chromedriver as uc
driver = uc.Chrome()
driver.get('https://nowsecure.nl')
sleep(10)
Maybe you can omit freeze_support()
in your case.
And as someone suggests, I would move import undetected_chromedriver as uc
to the top, though.