pythonpipundetected-chromedriver

Error installing the Python library undetected-chromedriver


I decided to try parsing the OZON marketing plugin, for this you need Python library undetected-chromedriver. But when entering a query - "pip install undetected-chromedriver", the following error occurs:

Defaulting to user installation because normal site-packages is not writeable
Collecting undetected-chromedriver     
    Using cached undetected-chromedriver-3.5.5.tar.gz (65 kB)     
    Preparing metadata (setup.py) ... error      
    error: subprocess-exited-with-error    

    × python setup.py egg_info did not run successfully.
    │ exit code: 1
    ╰─> [43 lines of output]
        Traceback (most recent call last):
          File "<string>", line 2, in <module>
          File "<pip-setuptools-caller>", line 34, in <module>
          File "C:\Users\I\AppData\Local\Temp\pip-install-dn9by6m0\undetected-chromedriver_20cb32eae0cb41a5a84a593f42c4e6fc\setup.py", line 39, in <module>
            setup(
          File "C:\Users\I\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\setuptools_init_.py", line 117, in setup
            return distutils.core.setup(**attrs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "C:\Users\I\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\setuptools_distutils\core.py", line 145, in setup
            _setup_distribution = dist = klass(attrs)
                                         ^^^^^^^^^^^^
          File "C:\Users\I\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\setuptools\dist.py", line 283, in __init__
            _Distribution.init(self, dist_attrs)
          File "C:\Users\I\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\setuptools_distutils\dist.py", line 279, in __init__
            self.finalize_options()
          File "C:\Users\I\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\setuptools\dist.py", line 634, in finalize_options
            for ep in sorted(loaded, key=by_order):
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "C:\Users\I\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\setuptools\dist.py", line 633, in <lambda>
            loaded = map(lambda e: e.load(), filtered)
                                   ^^^^^^^^
          File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1776.0_x64__qbz5n2kfra8p0\Lib\importlib\metadata_init.py", line 205, in load
            module = import_module(match.group('module'))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1776.0_x64__qbz5n2kfra8p0\Lib\importlib_init.py", line 90, in import_module
            return _bootstrap._gcd_import(name[level:], package, level)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
          File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
          File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
          File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
          File "<frozen importlib._bootstrap_external>", line 995, in exec_module
          File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
          File "C:\Users\I\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\cx_Freeze_init.py", line 11, in <module>
            from .command.build_exe import BuildEXE as build_exe
          File "C:\Users\I\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\cx_Freeze\command\build_exe.py", line 14, in <module>
            from cx_Freeze.freezer import Freezer
          File "C:\Users\I\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\cx_Freeze\freezer.py", line 31, in <module>
            from .finder import ModuleFinder
          File "C:\Users\I\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\cx_Freeze\finder.py", line 33, in <module>
            IMPORT_STAR = opcode.opmap["IMPORT_STAR"]
                          ~~~~~~~~~~~~^^^^^^^^^^^^^^^
        KeyError: 'IMPORT_STAR'
        [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata. 
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. 
hint: See above for details.

I tried to change the pip version.

Please help to solve this problem.


Solution

  • Information about this package on PyPi shows that it supports Python 3.7 - 3.11.

    You may want to downgrade your Python from 3.12 to 3.10 or 3.11 and try again.