Description
Reading this issue (#1568) I have learned that it should be possible to use robotframework
with Python 3 and still use RIDE with Python 2 (I need Python 3 functionality for my test cases).
So what I did (I am on Windows 7):
I installed Python 3.6 so that I have installed 2.7 and 3.6 in parallel now. Python 3 is in my PATH
.
I start RIDE using Python 2.7 by this command:
C:\Python27\pythonw.exe -c "from robotide import main; main()"
So RIDE seems to run fine. Now when I run a test then RIDE actually tries to run pybot.bat
using Python 3 but it fails to load the TestAgentRunner.py
:
command: pybot.bat -L TRACE -V C:\Projects\testing\robot-framework-testing\trunk\myproject\configs\hi_lab.py --argumentfile c:\users\robin\appdata\local\temp\RIDEugz9lw.d\argfile.txt --listener C:\Python27\lib\site-packages\robotide\contrib\testrunner\TestRunnerAgent.py:58899:False C:\Projects\testing\robot-framework-testing\trunk\myproject\robot-framework
C:\Users\robin\AppData\Local\Programs\Python\Python36\lib\runpy.py:125: RuntimeWarning: 'robot.run' found in sys.modules after import of package 'robot', but prior to execution of 'robot.run'; this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
[ ERROR ] Taking listener 'C:\Python27\lib\site-packages\robotide\contrib\testrunner\TestRunnerAgent.py:58899:False' into use failed: Importing listener 'C:\Python27\lib\site-packages\robotide\contrib\testrunner\TestRunnerAgent.py' failed: SyntaxError: invalid syntax (TestRunnerAgent.py, line 196)
Traceback (most recent call last):
None
PYTHONPATH:
C:\Users\robin\AppData\Local\Programs\Python\Python36\python36.zip
C:\Users\robin\AppData\Local\Programs\Python\Python36\DLLs
C:\Users\robin\AppData\Local\Programs\Python\Python36\lib
C:\Users\robin\AppData\Local\Programs\Python\Python36
C:\Users\robin\AppData\Local\Programs\Python\Python36\lib\site-packages
The test still runs but no runtime info is displayed (expect console output) and no test result is displayed. I think this is the relevant error:
[ ERROR ] Taking listener 'C:\Python27\lib\site-packages\robotide\contrib\testrunner\TestRunnerAgent.py:58899:False' into use failed: Importing listener 'C:\Python27\lib\site-packages\robotide\contrib\testrunner\TestRunnerAgent.py' failed: SyntaxError: invalid syntax (TestRunnerAgent.py, line 196)
I can understand that it cannot import the TestRunnerAgent.py
(from RIDE) into the Python 3 environment. But is there a solution to use robotframework
with Python 3 while still using RIDE?
Activity
HelioGuilherme66 commentedon Jul 24, 2017
Yes, there is a solution for your problem.
Install from my fork, and that problem is gone. (and new ones may appear ;))
pip2 install -U https://github.com/HelioGuilherme66/RIDE/archive/python3.zip
(branch
python3
, still only compatible with 2.7)You should also see my fork releases page
verybadsoldier commentedon Jul 24, 2017
Thanks for fast reply!
I did that:
But now it cannot run anymore:
Maybe any dependencies to other packages?
HelioGuilherme66 commentedon Jul 24, 2017
Oops, sorry about that.
That is a nice feature to ... for long names in the tree explorer, but it does not exist in wxPython 2.8.12.1.
Please edit the file and remove
| customtreectrl.TR_ELLIPSIZE_LONG_ITEMS
at line 55 "C:\Python27\lib\site-packages\robotide\ui\tree.py".After that you could add:
This is the original code, if you prefer:
There maybe problems with your existings settings on
C:\Users\%USERNAME%\AppData\Roaming\RobotFramework\ride
There will be no
pybot
selection, you must selectrobot
.This is change on
settings.cfg
:(I am available at our Slack)
Fix tree improvements for wxPython pre Phoenix.
verybadsoldier commentedon Jul 24, 2017
It is working now! Thanks alot!
I reinstalled
RIDE
from your URL to do the change in the code but it seems you already did it in the meantime. So I did not have to change anything and it is working now.As you said, my
Execution Profile
combo box was empty so I selectedrobot
and it works now, thanks!pritamd7k commentedon Sep 2, 2018
Now how you will gonna use the Robot Framework for your upgraded versions for 64 bit upgraded system without facing issues:
I would like to mention few corrections,
1.while installing wxpython:
you might not need to download wxpython Separately,
Just Open your CMD>Type "pip install wxpython" //(without quote).
2.if you have 64 bit system , try to install 64 bit version of python so that there will be compatibility issues with Eclipse in future.
3.if you are using latest version win10, don't need to add path for Env.Variable Separately , just tick the checkbox "add path" while installing python.
4.While installing latest version of python in Win10, select customized installation and add the path location(where to install>create a new folder in C drive,>named it as Python>and install with providing that as a destination folder)
5.Now the main problem is while installing robotframwork-ride,
if you want install through :Step 1(Step 1 will not work , follow step 2)
C:\Users\pritam>pip install robotframework-ride
following erreor you will get , because Python 3.0 or above doesn't content exec file!
" Traceback (most recent call last):
File "", line 1, in
File "C:\Users\pritam\AppData\Local\Temp\pip-install-53rehg50\robotframework-ride\setup.py", line 20, in
execfile(join(ROOT_DIR, 'src', 'robotide', 'version.py'))
NameError: name 'execfile' is not defined"
Step 2:(Alternative way)
Type the following command it will download and install
C:\Users\pritam>pip install -U --pre https://github.com/HelioGuilherme66/RIDE/archive/python3.zip
6.write ride.py and click enter , it will not work showing the error
reason:for the latest version there are having few compatible issues
to solve the issue follow the steps:known issue:
https://github.com/HelioGuilherme66/RIDE/releases/tag/v1.7.2
pip install -U -r https://raw.githubusercontent.com/HelioGuilherme66/RIDE/v1.7.2/requirements.txt
then,
pip install -U https://github.com/HelioGuilherme66/RIDE/archive/v1.7.2.tar.gz
7.now run ride.py
it will work