Bhagyadish
Bhagyadish

Reputation: 11

Getting below error when i am installing robot framework-appiumlibrary

D:\Users\SBhagyad>pip install robotframework-appiumlibrary
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting robotframework-appiumlibrary
  Using cached robotframework_appiumlibrary-1.5.0.6-py2.py3-none-any.whl (33 kB)
Requirement already satisfied: robotframework>=2.6.0 in c:\python27\lib\site-packages (from robotframework-appiumlibrary) (3.1.2)
Requirement already satisfied: six>=1.10.0 in c:\python27\lib\site-packages (from robotframework-appiumlibrary) (1.14.0)
Collecting Appium-Python-Client>=0.28
  Using cached Appium-Python-Client-1.0.1.tar.gz (51 kB)
    ERROR: Command errored out with exit status 1:
     command: 'c:\python27\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'d:\\users\\sbhagyad\\appdata\\local\\temp\\1\\pip-install-qb7jnj\\Appium-Python-Client\\setup.py'"'"'; __file__='"'"'d:\\users\\sbhagyad\\appdata\\local\\temp\\1\\pip-install-qb7jnj\\Appium-Python-Client\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'd:\users\sbhagyad\appdata\local\temp\1\pip-pip-egg-info-dvpaun'
         cwd: d:\users\sbhagyad\appdata\local\temp\1\pip-install-qb7jnj\Appium-Python-Client\
    Complete output (8 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "d:\users\sbhagyad\appdata\local\temp\1\pip-install-qb7jnj\Appium-Python-Client\setup.py", line 19, in <module>
        from appium.common.helper import library_version
      File "appium\common\helper.py", line 20
        def extract_const_attributes(cls: type) -> Dict[str, Any]:
                                        ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Error

Getting Error when i am trying to install robot framework-appiumlibrary CMD Please help to provide any solution for this I am Using Python 2.7 and Robot Framework 3.1.2 (Python 2.7.16 on win32)

Upvotes: 1

Views: 2898

Answers (5)

anoop shetty
anoop shetty

Reputation: 1

If you are forced to use python 2.7 Install below version

   pip install Appium-Python-Client==0.52
   pip install robotframework-appiumlibrary==1.6

Upvotes: 0

zastress
zastress

Reputation: 21

If you are forced to use Python 2.7 like me, the solution is to first install a compatible version of Appium-Python-Client and then install your AppiumLibrary. For this, you can run the following commands:

pip install Appium-Python-Client==0.52
pip install robotframework-appiumlibrary

Upvotes: 2

S.C
S.C

Reputation: 61

You can install the specific version of the appium library which is compatible with Python 2.7 using below command:

pip install robotframework-appiumlibrary==<compatible_library_version>

where compatible_library_version is the version number compatible with Python 2.7

Upvotes: -1

Stefan Stefanovic
Stefan Stefanovic

Reputation: 11

I would suggest making a report on the AppiumLibrary github, as Python 2.7 should still be fully supported. This is a very big issue afterall.

UPDATE: The issue lies in the appium-python-client dependency, which is no longer supported on Python2. Currently the only feasible option is to update to Python3 and tell the devs that this is an issue. Alternatively you can look to install an older version that is workable for Python2, if that is even possible.

Upvotes: 1

Tom Carrick
Tom Carrick

Reputation: 6616

The library you're trying to use doesn't support Python 2.7, because Python 2.7 is old, insecure, and unsupported.

Upgrade to a supported Python version.

From the look of the error message, it uses type hinting, so you will need at least Python 3.5. However, 3.5 will also be end of life in September 2020, so it's worthwhile updating to the latest release, currently 3.8.

You should also use a virtual environment for each of your projects. This will let you easily use different versions of Python and other libraries on your system.

Upvotes: 0

Related Questions