[GH-ISSUE #54] [WhoScored] Module not working #7

Closed
opened 2026-03-02 15:54:58 +03:00 by kerem · 1 comment
Owner

Originally created by @gbordapoo on GitHub (Jun 6, 2022).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/54

Which Python version are you using?

Python 3.9.12

Which version of soccerdata are you using?

import soccerdata as sd
ws = sd.WhoScored(proxy='tor')

What did you do?

Install soccerdata with 'python3 -m pip install soccerdata'

What did you expect to see?

create ws variable

What did you see instead?

Output from spyder call 'get_cwd':
[06/05/22 22:08:48] INFO Saving cached data to /Users/gustavob _common.py:\91
orda/soccerdata/data/WhoScored
[06/05/22 22:08:50] INFO patching driver executable /Users/gu \patcher.py:\231
stavoborda/Library/Application Suppo
rt/undetected_chromedriver/b170e9511
dda09d2_chromedriver
[06/05/22 22:08:50] INFO No custom team name replacements _config.py:85
found. You can configure these in /Us
ers/gustavoborda/soccerdata/config/te
amname_replacements.json.
INFO No custom league dict found. You can _config.py:155
configure additional leagues in /Use
rs/gustavoborda/soccerdata/config/le
ague_dict.json.
INFO Saving cached data to /Users/gustavob _common.py:91
orda/soccerdata/data/WhoScored
[06/05/22 22:08:52] INFO patching driver executable /Users/gu patcher.py:231
stavoborda/Library/Application Suppo
rt/undetected_chromedriver/a44ea0bfa
6137f97_chromedriver

Output from spyder call 'get_cwd':


1

spawn.py 116 spawn_main
exitcode = _main(fd, parent_sentinel)

spawn.py 125 _main
prepare(preparation_data)

spawn.py 236 prepare
_fixup_main_from_path(data['init_main_from_path'])

spawn.py 287 _fixup_main_from_path
main_content = runpy.run_path(main_path,

runpy.py 268 run_path
return _run_module_code(code, init_globals, run_name,

runpy.py 97 _run_module_code
_run_code(code, mod_globals, init_globals,

runpy.py 87 _run_code
exec(code, run_globals)

untitled0.py 3
ws = sd.WhoScored(proxy='tor')

whoscored.py 87 init
super().init(

_common.py 383 init
self._driver = self._init_webdriver()

_common.py 410 _init_webdriver
return uc.Chrome(options=chrome_options)

init.py 388 init
self.browser_pid = start_detached(

dprocess.py 30 start_detached
multiprocessing.Process(

process.py 121 start
self._popen = self._Popen(self)

context.py 224 _Popen
return _default_context.get_context().Process._Popen(process_obj)

context.py 284 _Popen
return Popen(process_obj)

popen_spawn_posix.py 32 init
super().init(process_obj)

popen_fork.py 19 init
self._launch(process_obj)

popen_spawn_posix.py 42 _launch
prep_data = spawn.get_preparation_data(process_obj._name)

spawn.py 154 get_preparation_data
_check_not_importing_main()

spawn.py 134 _check_not_importing_main
raise RuntimeError('''

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.
Originally created by @gbordapoo on GitHub (Jun 6, 2022). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/54 Which Python version are you using? Python 3.9.12 Which version of soccerdata are you using? import soccerdata as sd ws = sd.WhoScored(proxy='tor') What did you do? Install soccerdata with 'python3 -m pip install soccerdata' What did you expect to see? create ws variable What did you see instead? Output from spyder call 'get_cwd': [06/05/22 22:08:48] INFO Saving cached data to /Users/gustavob \_common.py\:\91\ orda/soccerdata/data/WhoScored [06/05/22 22:08:50] INFO patching driver executable /Users/gu \patcher.py\:\231\ stavoborda/Library/Application Suppo rt/undetected_chromedriver/b170e9511 dda09d2_chromedriver [06/05/22 22:08:50] INFO No custom team name replacements _config.py:85 found. You can configure these in /Us ers/gustavoborda/soccerdata/config/te amname_replacements.json. INFO No custom league dict found. You can _config.py:155 configure additional leagues in /Use rs/gustavoborda/soccerdata/config/le ague_dict.json. INFO Saving cached data to /Users/gustavob _common.py:91 orda/soccerdata/data/WhoScored [06/05/22 22:08:52] INFO patching driver executable /Users/gu patcher.py:231 stavoborda/Library/Application Suppo rt/undetected_chromedriver/a44ea0bfa 6137f97_chromedriver Output from spyder call 'get_cwd': ------------------------------------------------------------------------------- <string> 1 <module> spawn.py 116 spawn_main exitcode = _main(fd, parent_sentinel) spawn.py 125 _main prepare(preparation_data) spawn.py 236 prepare _fixup_main_from_path(data['init_main_from_path']) spawn.py 287 _fixup_main_from_path main_content = runpy.run_path(main_path, runpy.py 268 run_path return _run_module_code(code, init_globals, run_name, runpy.py 97 _run_module_code _run_code(code, mod_globals, init_globals, runpy.py 87 _run_code exec(code, run_globals) untitled0.py 3 <module> ws = sd.WhoScored(proxy='tor') whoscored.py 87 __init__ super().__init__( _common.py 383 __init__ self._driver = self._init_webdriver() _common.py 410 _init_webdriver return uc.Chrome(options=chrome_options) __init__.py 388 __init__ self.browser_pid = start_detached( dprocess.py 30 start_detached multiprocessing.Process( process.py 121 start self._popen = self._Popen(self) context.py 224 _Popen return _default_context.get_context().Process._Popen(process_obj) context.py 284 _Popen return Popen(process_obj) popen_spawn_posix.py 32 __init__ super().__init__(process_obj) popen_fork.py 19 __init__ self._launch(process_obj) popen_spawn_posix.py 42 _launch prep_data = spawn.get_preparation_data(process_obj._name) spawn.py 154 get_preparation_data _check_not_importing_main() spawn.py 134 _check_not_importing_main raise RuntimeError(''' 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.
kerem closed this issue 2026-03-02 15:54:58 +03:00
Author
Owner

@probberechts commented on GitHub (Jun 6, 2022):

This is a frequently recurring issue in the undetected-chromedriver repo. See for example, #561. Basically, you have to protect the constructor when you run it from a script.

import soccerdata as sd
if __name__ == '__main__':
    ws = sd.WhoScored(proxy='tor')
<!-- gh-comment-id:1147652166 --> @probberechts commented on GitHub (Jun 6, 2022): This is a frequently recurring issue in the undetected-chromedriver repo. See for example, [#561](https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/561#issuecomment-1075363395). Basically, you have to protect the constructor when you run it from a script. ```py import soccerdata as sd if __name__ == '__main__': ws = sd.WhoScored(proxy='tor') ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/soccerdata#7
No description provided.