安装Python库时出错未检测到的chromedriver

问题描述 投票:0回答:1

我决定尝试解析 OZON 营销插件,为此你需要 Python 库 undetected-chromedriver。但是当输入查询 - “pip install unDetected-chromedriver”时,会出现以下错误:

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.

我尝试更改 pip 版本。

请帮忙解决这个问题。

python pip undetected-chromedriver
1个回答
0
投票

PyPi上有关此包的信息表明它支持Python 3.7 - 3.11。

您可能需要将 Python 从 3.12 降级到 3.10 或 3.11,然后重试。

© www.soinside.com 2019 - 2024. All rights reserved.