Problem with running of undetected_chromedriver on Linux(Gentoo)

i'm a new developer by Python and at this time i don't have enough experience to solve this problem. I have a problem when i'm starting the module undetected_chromedriver on Linux(Gentoo)

I'm using : undetected_chromedriver version = 3.1.5r4, Python version = 3.8.5

I also created a local_variable to link to the chromedriver file.

export CHROMEDRIVER_PATH = '/path_to_chromedriver/node_modules/chromedriver/bin/chromedriver'

This is the Python script I am running:

import undetected_chromedriver as UC_1
options = UC_1.ChromeOptions()

driver = UC_1.Chrome(driver_executable_path = os.environ.get('CHROMEDRIVER_PATH'), options=options, service_log_path= dir_name + '/chromedriver.log', use_subprocess=True)

When i start the script, it raises this error: (python script is running with logging.basicConfig(level=logging.DEBUG))

Info from console:

INFO:undetected_chromedriver.patcher:patching driver executable /path_to_chromedriver/node_modules/chromedriver/bin/chromedriver
DEBUG:uc:created a temporary folder in which the user-data (profile) will be stored during this
session, and added it to chrome startup arguments: --user-data-dir=/tmp/tmp_fypdc2_
DEBUG:uc:did not find a bad exit_type flag

Error: Traceback (most recent call last):
  File "", line 219, in <module>
    driver = UC_1.Chrome(driver_executable_path = os.environ.get('CHROMEDRIVER_PATH'), options = options, service_log_path = dir_name + '/chromedriver.log', use_subprocess = True)
  File "/path_to_env/.venv/lib/python3.8/site-packages/undetected_chromedriver/", line 392, in __init__
    browser = subprocess.Popen(
  File "/usr/lib/python3.8/", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/", line 1627, in _execute_child
    executable = os.fsencode(executable)
  File "/usr/lib/python-exec/python3.8/../../../lib/python3.8/", line 806, in fsencode
    filename = fspath(filename)  # Does type-checking of `filename`.
TypeError: expected str, bytes or os.PathLike object, not NoneType

Please, could you tell me, where a i make a mistake? And how i can solve this error?

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum