Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error occurs during installation of Robot Framework with Python on Windows 7

I have installed "python-3.3.0.msi" successfully and set up PATH as "C:\Python33;" on Windows 7. After that I tried to install Robot Framework by using "robotframework-2.7.7.win32.exe" (double click on the .exe file). At the last step of installation I found the following error:

File "<string>", line 35
    except Exception, err:
                    ^
SyntaxError: invalid syntax

I clicked on "Finish" button --> Installation wizard was disappeared. I set the PATH as "C:\Python33\Scripts". Then I checked the version by using the command "pybot --version" at command prompt. Below error was shown:

Traceback (most recent call last):
  File "C:\Python33\lib\runpy.py", line 140, in _run_module_as_main
    mod_name, loader, code, fname = _get_module_details(mod_name)
  File "C:\Python33\lib\runpy.py", line 102, in _get_module_details
    loader = get_loader(mod_name)
  File "C:\Python33\lib\pkgutil.py", line 482, in get_loader
    return find_loader(fullname)
  File "C:\Python33\lib\pkgutil.py", line 499, in find_loader
    pkg = importlib.import_module(pkg_name)
  File "C:\Python33\lib\importlib\__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 586, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1023, in load_module
  File "<frozen importlib._bootstrap>", line 1004, in load_module
  File "<frozen importlib._bootstrap>", line 562, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 869, in _load_module
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "C:\Python33\lib\site-packages\robot\__init__.py", line 22, in <module>
    from robot.rebot import rebot, rebot_cli
  File "C:\Python33\lib\site-packages\robot\rebot.py", line 268, in <module>
    from robot.conf import RebotSettings
  File "C:\Python33\lib\site-packages\robot\conf\__init__.py", line 17, in <mo
    from .settings import RobotSettings, RebotSettings
  File "C:\Python33\lib\site-packages\robot\conf\settings.py", line 172
    except EnvironmentError, err:
                           ^
SyntaxError: invalid syntax

How can I solve the above error?

like image 310
Ripon Al Wasim Avatar asked Mar 28 '13 08:03

Ripon Al Wasim


People also ask

Which Python version is best for robot framework?

Robot Framework requires Python 3.6 or newer. If you need to use Python 2, Jython or IronPython, you can use Robot Framework 4.1.3.

Is Python required for robot framework?

Robot framework is a generic open-source automation framework for acceptance testing, acceptance test-driven development, and robotic process automation. It uses the keyword-driven testing technique approach. The capabilities can be extended by test libraries that can be implemented by either Java or Python.

How do I run a robot framework in Linux?

Execute command - Executes the command in interactive shell. Get File - Downloads the given file from remote machine to local machine. Put File - Uploads asked file from local to remote machine. write - Writes command into interactive shell and waits for next command!


2 Answers

Robot Framework doesn't support Python 3 yet. You should try to use Python 2.7 instead. (Python 3 changes lots of things in the language syntax, including the syntax for catching exceptions shown in this traceback). So, follow the following installation steps:

  1. Install Python2.7.3
  2. Install robotframework2.7.7
  3. set PATH as "C:\Python27\;C:\Python27\Scripts\"
  4. Verify the installation by using the command "pybot --version" at command prompt. If everything is OK, the
    following message will be displayed: "Robot Framework 2.7.7 (Python 2.7.3 on win32)"
like image 178
Ripon Al Wasim Avatar answered Oct 17 '22 14:10

Ripon Al Wasim


you should run "pip install robotframework-python3" https://pypi.python.org/pypi/robotframework-python3

like image 31
Phuong Nguyen Avatar answered Oct 17 '22 16:10

Phuong Nguyen