authomatic / chromedriver_installer

ChromeDriver installer for Python
15 stars 34 forks source link

latest google release at https://sites.google.com/a/chromium.org/chromedriver/downloads breaks chromedriver_installer #9

Open jharveysmith opened 5 years ago

jharveysmith commented 5 years ago
$ pip install chromedriver_installer
Collecting chromedriver_installer
  Using cached https://files.pythonhosted.org/packages/c8/01/0a8a725bb605f68923aba16099a01cbbfe547c8b7dc96fd9a554424f6524/chromedriver_installer-0.0.6.tar.gz
Building wheels for collected packages: chromedriver-installer
  Running setup.py bdist_wheel for chromedriver-installer ... error
  Complete output from command /home/ubuntu/.venv/pr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-0napzveo/chromedriver-installer/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-mb8ywpxd --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  creating build/lib/chromedriver_installer
  copying chromedriver_installer/__init__.py -> build/lib/chromedriver_installer
  running build_scripts
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-0napzveo/chromedriver-installer/setup.py", line 220, in <module>
      cmdclass=dict(build_scripts=BuildScripts, install=Install)
    File "/usr/local/lib/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/lib/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/home/ubuntu/.venv/pr/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 188, in run
      self.run_command('build')
    File "/usr/local/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.6/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/local/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-0napzveo/chromedriver-installer/setup.py", line 119, in run
      chromedriver_version = get_chromedriver_version()
    File "/tmp/pip-install-0napzveo/chromedriver-installer/setup.py", line 47, in get_chromedriver_version
      .format(CHROMEDRIVER_INFO_URL))
  Exception: Unable to get latest chromedriver version from https://sites.google.com/a/chromium.org/chromedriver/downloads

  ----------------------------------------
  Failed building wheel for chromedriver-installer
  Running setup.py clean for chromedriver-installer
Failed to build chromedriver-installer
Installing collected packages: chromedriver-installer
  Running setup.py install for chromedriver-installer ... error
    Complete output from command /home/ubuntu/.venv/pr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-0napzveo/chromedriver-installer/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-urk9zw8c/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/.venv/pr/include/site/python3.6/chromedriver-installer:
    running install
    running build
    running build_py
    creating build
    creating build/lib
    creating build/lib/chromedriver_installer
    copying chromedriver_installer/__init__.py -> build/lib/chromedriver_installer
    running build_scripts
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-0napzveo/chromedriver-installer/setup.py", line 220, in <module>
        cmdclass=dict(build_scripts=BuildScripts, install=Install)
      File "/usr/local/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/tmp/pip-install-0napzveo/chromedriver-installer/setup.py", line 190, in run
        install.run(self)
      File "/usr/local/lib/python3.6/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/usr/local/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.6/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/local/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/tmp/pip-install-0napzveo/chromedriver-installer/setup.py", line 119, in run
        chromedriver_version = get_chromedriver_version()
      File "/tmp/pip-install-0napzveo/chromedriver-installer/setup.py", line 47, in get_chromedriver_version
        .format(CHROMEDRIVER_INFO_URL))
    Exception: Unable to get latest chromedriver version from https://sites.google.com/a/chromium.org/chromedriver/downloads

    ----------------------------------------
Command "/home/ubuntu/.venv/pr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-0napzveo/chromedriver-installer/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-urk9zw8c/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/.venv/pr/include/site/python3.6/chromedriver-installer" failed with error code 1 in /tmp/pip-install-0napzveo/chromedriver-installer/
conradolega commented 5 years ago

This package looks for the string Latest Release on the Chromedriver site to get the latest version (see this version of the page from January). The copy on the site changed, breaking this package.

Checking https://chromedriver.storage.googleapis.com/LATEST_RELEASE seems to be a better approach.

jharveysmith commented 5 years ago

Unfortunately, the latest version is 73.0.3683.20 and the https://chromedriver.storage.googleapis.com/LATEST_RELEASE still returns 2.46

pgAdmin commented 5 years ago

This can fix the installation till a proper fix is found. https://github.com/authomatic/chromedriver_installer/pull/10

LennyLip commented 4 years ago

Same error here

ominaik7 commented 4 years ago

Change

 CHROMEDRIVER_INFO_URL = (
    'http://chromedriver.storage.googleapis.com/LATEST_RELEASE'
)

to this url in setup.py

and change get_chromedriver_version match variable to to this

def get_chromedriver_version():
    """Retrieves the most recent chromedriver version."""
    global chromedriver_version

    response = request.urlopen(CHROMEDRIVER_INFO_URL)
    content = response.read()
    match = content.decode("utf-8")
    if match:
        return match
    else:
        raise Exception('Unable to get latest chromedriver version from {0}'
                        .format(CHROMEDRIVER_INFO_URL))