Skip to content

[FR] Be able to install python bindings from Github using pip #6470

Closed
@motin

Description

@motin

TL;DR
Due to the way we build this project you can't install from Github. You will either need to use the version on pypi or clone the repo and follow the build steps.

Long version
We are currently dependent on this pending PR: #6463, thus we have added the following to requirements.txt:

-e git://github.com/motin/selenium.git@add-python-client-support-for-webextensions-in-firefox#egg=selenium&subdirectory=py

This however results in a broken package, yielding errors like:

__________________________________ ERROR ... __________________________________
...
.tox/py36/src/selenium/py/selenium/webdriver/__init__.py:18: in <module>
    from .firefox.webdriver import WebDriver as Firefox  # noqa
.tox/py36/src/selenium/py/selenium/webdriver/firefox/webdriver.py:29: in <module>
    from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
.tox/py36/src/selenium/py/selenium/webdriver/remote/webdriver.py:26: in <module>
    from .webelement import WebElement
.tox/py36/src/selenium/py/selenium/webdriver/remote/webelement.py:43: in <module>
    getAttribute_js = pkgutil.get_data(_pkg, 'getAttribute.js').decode('utf8')
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py:591: in get_data
    return loader.get_data(resource_name)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py:255: in get_data
    return open(pathname, "rb").read()
E   IOError: [Errno 2] No such file or directory: '.../.tox/py36/src/selenium/py/selenium/webdriver/remote/getAttribute.js'

Meta -

OS: OSX
Selenium Version: PR

Expected Behavior -

No difference in behavior or functionality than when not installed directly from github.

Actual Behavior -

Selenium runs into issue with missing files in the package.

Steps to reproduce -

  1. Install python bindings from Github using pip:
pip install -e git://github.com/SeleniumHQ/selenium.git#egg=selenium&subdirectory=py
  1. Attempt to use selenium in your project as usual, for instance access the remote webdriver:
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver

Notes

The same error has previously been observed here and here.

It is possible to workaround this by followed the build instructions here
https://github.com/SeleniumHQ/selenium/wiki/Python-Bindings#development
and then manually copying the built package contents to the site-packages/selenium/ folder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions