Exception occurred in file 'env/lib/python3.11/site-packages/webdriver_manager/drivers/chrome.py', line 64: 'NoneType' object has no attribute 'split'.

I am using pyhtml2pdf for converting HTML to PDF which has a requirement of Chrome headless.

converter.convert(f'file:///{path}', pdf_file_path)

When the server is run as python manage.py runserver there is no issue.

But when the django is run as a service it throws and error regarding split with chrome.py :

Exception occurred in file ‘/var/www/myProject/env/lib/python3.11/site-packages/webdriver_manager/drivers/chrome.py’, line 64: ‘NoneType’ object has no attribute ‘split’.

Our service :

cat /etc/systemd/system/myProject.service
Description=myProject_0 project

ExecStart=/bin/bash -c 'source /var/www/myProject/env/bin/activate && python manage.py runserver'


We troubleshooted this for a long time and found out then when run as python manage.py runserver on our Ubuntu 20.04 server on an Azure VM this chrome.py error doesn’t throw up.

Where did we go wrong ?

As a quick temporary fix I did this :

Ugly hack - not a long term solution but works as of now.

This function in /var/www/myProject/env/lib/python3.11/site-packages/webdriver_manager/drivers/chrome.py was causing the issue :

def get_latest_release_version(self):

I gave a return value right after entering this function
return “125.0.6422.112”