nickpadd / EuropeanFootballLeaguePredictor

A machine learning/statistical model to derive prediction probabilities for football matches of the top european leagues.
https://nickpadd.github.io/EuropeanFootballLeaguePredictor/Home.html
MIT License
36 stars 7 forks source link

Update command failed #69

Closed PatWekan closed 7 months ago

PatWekan commented 7 months ago

After successfully installing the scripts i am able to open the WebGui und see results by mod of March.

Trying to run the update command python run_updates.py

i got some error messages, see attached:

EuropeanFootballLeaguePredictor % python run_updates.py
2024-04-02 19:59:42.057 | SUCCESS | europeanfootballleaguepredictor.common.config_parser:load_and_extract_yaml_section:38 - Successfully loaded the config.yaml 2024-04-02 19:59:42.059 | SUCCESS | europeanfootballleaguepredictor.common.config_parser:load_and_extract_yaml_section:47 - Successfully loaded europeanfootballleaguepredictor/data/leagues/EPL/dictionaries/bookmaker.yaml 2024-04-02 19:59:42.060 | SUCCESS | europeanfootballleaguepredictor.common.config_parser:load_and_extract_yaml_section:47 - Successfully loaded europeanfootballleaguepredictor/data/leagues/EPL/dictionaries/data_co_uk.yaml 2024-04-02 19:59:42.062 | SUCCESS | europeanfootballleaguepredictor.common.config_parser:load_and_extract_yaml_section:47 - Successfully loaded europeanfootballleaguepredictor/data/leagues/EPL/dictionaries/fixture_download.yaml 2024-04-02 19:59:42.062 | INFO | main:main:35 - Configuration(league='EPL', regressor=<class 'sklearn.linear_model._glm.glm.PoissonRegressor'>, bettor_bank=60, bettor_kelly_cap=0.05, evaluation_output='europeanfootballleaguepredictor/data/leagues/EPL/evaluation/', months_of_form_list=[None, 3], database='europeanfootballleaguepredictor/data/database/EPL_database.db', seasons_to_gather=['2017', '2018', '2019', '2020', '2021', '2022', '2023'], current_season='2023', data_co_uk_path='europeanfootballleaguepredictor/data/leagues/EPL/DataCoUkFiles/', bookmaker_url='https://en.stoiximan.gr/sport/soccer/england/premier-league/1/', bookmaker_dictionary={'Fulham FC': 'Fulham', 'Everton FC': 'Everton', 'Leeds United': 'Leeds', 'Southampton FC': 'Southampton', 'West Ham United': 'West Ham', 'Arsenal FC': 'Arsenal', 'AFC Bournemouth': 'Bournemouth', 'Crystal Palace FC': 'Crystal Palace', 'Liverpool FC': 'Liverpool', 'Brighton & Hove Albion': 'Brighton', 'Chelsea FC': 'Chelsea', 'Tottenham Hotspur': 'Tottenham', 'Brentford FC': 'Brentford', 'Burnley FC': 'Burnley', 'Luton Town': 'Luton'}, data_co_uk_url='https://www.football-data.co.uk/mmz4281/2324/E0.csv', data_co_uk_dictionary={'Man City': 'Manchester City', 'Man United': 'Manchester United', "Nott'm Forest": 'Nottingham Forest', 'Newcastle': 'Newcastle United', 'Wolves': 'Wolverhampton Wanderers'}, fixture_download_url='https://fixturedownload.com/download/epl-2023-GMTStandardTime.csv', fixture_download_dictionary={'Man City': 'Manchester City', 'Sheffield Utd': 'Sheffield United', 'Man Utd': 'Manchester United', 'Newcastle': 'Newcastle United', 'Spurs': 'Tottenham', 'Wolves': 'Wolverhampton Wanderers'}, voting_dict={'long_term': 0.6, 'short_term': 0.4}, matchdays_to_drop=4) Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 1348, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1282, in request self._send_request(method, url, body, headers, encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1328, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1277, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1037, in _send_output self.send(msg) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 975, in send self.connect() File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1454, in connect self.sock = self._context.wrap_socket(self.sock, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 517, in wrap_socket return self.sslsocket_class._create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 1075, in _create self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 1346, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/xxx/EuropeanFootballLeaguePredictor/run_updates.py", line 81, in main() File "/Users/xxx/EuropeanFootballLeaguePredictor/run_updates.py", line 39, in main bookmaker_scraper = BookmakerScraper(url = config.bookmaker_url, dictionary = config.bookmaker_dictionary) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/xxx/EuropeanFootballLeaguePredictor/europeanfootballleaguepredictor/data/bookmaker_scraper.py", line 44, in init self.driver = uc.Chrome(version_main = 122) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/xxx/Library/Caches/pypoetry/virtualenvs/europeanfootballleaguepredictor-sCU5w1aK-py3.11/lib/python3.11/site-packages/undetected_chromedriver/init.py", line 258, in init self.patcher.auto() File "/Users/xxx/Library/Caches/pypoetry/virtualenvs/europeanfootballleaguepredictor-sCU5w1aK-py3.11/lib/python3.11/site-packages/undetected_chromedriver/patcher.py", line 175, in auto release = self.fetch_release_number() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/xxx/Library/Caches/pypoetry/virtualenvs/europeanfootballleaguepredictor-sCU5w1aK-py3.11/lib/python3.11/site-packages/undetected_chromedriver/patcher.py", line 259, in fetch_release_number with urlopen(self.url_repo + path) as conn: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 216, in urlopen return opener.open(url, data, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 519, in open response = self._open(req, data) ^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 536, in _open result = self._call_chain(self.handle_open, protocol, protocol + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 496, in _call_chain result = func(*args) ^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 1391, in https_open return self.do_open(http.client.HTTPSConnection, req, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 1351, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to(euro(eur(eu(e(e((((((e(e(eu(eu(eu(e(e(((((((((((((((((((e(e(europ(eu(eu(eur(((((e(e((e(e(((((((((e(e(((((e(eu(e(e(eu(eu(eu(((europeanfootballleaguepredictor-py3.11)

nickpadd commented 7 months ago

The issue seems to be similar to: https://github.com/python-poetry/poetry/issues/5117

It is related to opening an undetected browser in order to scrape the odds. I will push an attempt for a fix.

nickpadd commented 7 months ago

PatWekan I am not sure if the issue is now fixed because I could not replicate it. Can you pull the repository again and try to see if it is solved?

PatWekan commented 7 months ago

Hi @nickpadd : many thanks, i have been able to update successfully :)

nickpadd commented 7 months ago

@PatWekan Keep in mind that the scraper fully works for greek ip addresses so it can access the bookmaker website. Else it will just produce it's own predictions without comparing them to the bookmaker.

Feel free to create an issue for anything else that comes up.

PatWekan commented 7 months ago

Hello

i am sorry, today i get the same error again by runing the update command

PatWekan commented 7 months ago

i found the fix for Mac OS: /Applications/Python\ 3.11/Install\ Certificates.command (for v3.11)