You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have installed Selenium2 library with Robot framework and Ride and have configured corresponding Path variables.
I wrote a simple test to open a browser. However on Run i get the foll error. Kindly clarify
[ ERROR ] Error in file 'D:\py 2.7\Scripts\testRide\testride1.txt' in table 'Settings': Importing test library 'D:/py 2.7/Lib/site-packages/Selenium2Library' failed: ImportError: No module named decorator
PYTHONPATH: ['D:\py 2.7\Lib\site-packages\robot\libraries', 'D:\py 2.7\Lib', 'D:\py 2.7\Scripts', 'D:\py 2.7\Lib\site-packages', 'D:\py 2.7\Lib\site-packages\Selenium2Library', 'D:\py 2.7\Lib\site-packages\robotide', 'D:\py 2.7\Lib\site-packages\wx-2.8-msw-unicode', 'C:\WINNT\system32\python27.zip', 'D:\py 2.7\DLLs', 'D:\py 2.7\lib\plat-win', 'D:\py 2.7\lib\lib-tk', 'D:\py 2.7', 'D:\py 2.7\Lib\site-packages\robot', '.']
Traceback (most recent call last):
File "D:\py 2.7\Lib\site-packages\robot\utils\importing.py", line 84, in non_dotted_import
module = import_module_by_path(name)
File "D:\py 2.7\Lib\site-packages\robot\utils\importing.py", line 38, in import_module_by_path
module = import(modname)
File "D:\py 2.7\Lib\site-packages\Selenium2Library__init.py", line 2, in
from keywords import *
File "D:\py 2.7\Lib\site-packages\Selenium2Library\keywords__init_.py", line 1, in
from _logging import _LoggingKeywords
File "D:\py 2.7\Lib\site-packages\Selenium2Library\keywords_logging.py", line 5, in
from keywordgroup import KeywordGroup
File "D:\py 2.7\Lib\site-packages\Selenium2Library\keywords\keywordgroup.py", line 4, in
from decorator import decorator
It looks like you need to install the decorator package, http://pypi.python.org/pypi/decorator/3.3.2. I'm not too familiar yet with windows installations but you can use easy_install, if available, or download the source package, from PyPI and install using python. Both methods are documented on the decorator package PyPI website.
Also with the latest 1.0.0 release of robotframework-selenium2library if you install robotframework-selenium2library using easy_install it should also install the necessary dependencies. - Ed
@emanlove - The "decorator module not found" issue is not seen now after installing the decorator package, however I am displayed the foll error.
[ ERROR ] Error in file 'D:\py 2.7\Scripts\testRide\testride1.txt' in table 'Settings': Importing test library 'D:/py 2.7/Lib/site-packages/Selenium2Library' failed: ImportError: No module named selenium
PYTHONPATH: ['D:\py 2.7\Lib\site-packages\robot\libraries', 'D:\py 2.7\Lib', 'D:\py 2.7\Scripts', 'D:\py 2.7\Lib\site-packages', 'D:\py 2.7\Lib\site-packages\Selenium2Library', 'D:\py 2.7\Lib\site-packages\robotide', 'D:\py 2.7\Lib\site-packages\wx-2.8-msw-unicode', 'C:\WINNT\system32\python27.zip', 'D:\py 2.7\DLLs', 'D:\py 2.7\lib\plat-win', 'D:\py 2.7\lib\lib-tk', 'D:\py 2.7', 'D:\py 2.7\Lib\site-packages\robot', '.']
Traceback (most recent call last):
File "D:\py 2.7\Lib\site-packages\robot\utils\importing.py", line 84, in non_dotted_import
module = import_module_by_path(name)
File "D:\py 2.7\Lib\site-packages\robot\utils\importing.py", line 38, in import_module_by_path
module = import(modname)
File "D:\py 2.7\Lib\site-packages\Selenium2Library__init.py", line 2, in
from keywords import *
File "D:\py 2.7\Lib\site-packages\Selenium2Library\keywords__init_.py", line 3, in
from _browsermanagement import _BrowserManagementKeywords
File "D:\py 2.7\Lib\site-packages\Selenium2Library\keywords_browsermanagement.py", line 4, in
from selenium import webdriver
@j1z0 - I installed Selenium2 library using the Windows installer "robotframework-selenium2library-1.0.0.win32.exe" and have imported the path to the test suite e.g. D:/py 2.7/Lib/site-packages/Selenium2Library
the windows installer doesn't package all the dependencies.... we can look into it doing that... the best solution is
pip install Selenium2Library. if you do that it will install all dependencies for you, including selenium, robot framework, decorator and whatever else.
preshri, so building off of j1z0 comments about the windows install vs. installing using "pip install Selenium2Library", you will need to also install the selenium package.
@j1z0,@rtomac, @Myself - we might need to change the documentation so to reflect this more clearly. Also I thinking we might need a small pip/easy_install tutorial; like how to upgrade or pull a specific version.
Concerning python's packaging tools there are two with very similar names, distutils and Distribute, but with different functionality. Distribute apparently is an upgrade and performs much better across platforms. There currently is an issue with installing robotframework on Linux using buildout (another "python-based configuration-driven build tool") which I am looking into and because it involves python packaging I will see about limitations for Win 64 bit.
Set [Python installation dir]\Lib and [Python installation dir]\Scripts to Path env. variable (not sure if this is even necessary, it used to be with RF and SeleniumLibrary)
I followed Harri's steps on a 32-bit windows machine. It didn't fix the decorator module error for me, but easy_install (picked up in step 2) came in handy.
My steps and results:
installed python-2.7.2 for 32 bit Windows XP
downloaded and ran ez_setup.py
C:\qa_automation_git\pa2>python ez_setup.py
Downloading http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-p
y2.7.egg
Processing setuptools-0.6c11-py2.7.egg
Copying setuptools-0.6c11-py2.7.egg to c:\python27\lib\site-packages
Adding setuptools 0.6c11 to easy-install.pth file
Installing easy_install-script.py script to C:\Python27\Scripts
Installing easy_install.exe script to C:\Python27\Scripts
Installing easy_install.exe.manifest script to C:\Python27\Scripts
Installing easy_install-2.7-script.py script to C:\Python27\Scripts
Installing easy_install-2.7.exe script to C:\Python27\Scripts
Installing easy_install-2.7.exe.manifest script to C:\Python27\Scripts
Installed c:\python27\lib\site-packages\setuptools-0.6c11-py2.7.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11
Execute easy_install
C:>easy_install robotframework-selenium2library
Processing robotframework-selenium2library
Running rtomac-robotframework-selenium2library-893dc2c\setup.py -q bdist_egg --d
ist-dir C:\robotframework-selenium2library\rtomac-robotframework-selenium2librar
y-893dc2c\egg-dist-tmp-krzthy
warning: no previously-included files found matching '_.rst'
warning: no files found matching '.rst' under directory 'demo'
warning: no files found matching '.sh' under directory 'demo'
warning: no files found matching '.bat' under directory 'demo'
warning: no files found matching '_.js' under directory 'demo'
no previously-included directories found matching 'demo\reports'
no previously-included directories found matching 'demo\selenium_log.txt'
no previously-included directories found matching 'demo\output.xml'
warning: no previously-included files matching '*.pyc' found under directory 'sr
c'
zip_safe flag not set; analyzing archive contents...
ez_setup: module MAY be using inspect.getsourcefile
Selenium2Library.init: module references file
Selenium2Library.keywords._browsermanagement: module references file
Adding robotframework-selenium2library 1.0.0 to easy-install.pth file
Installed c:\python27\lib\site-packages\robotframework_selenium2library-1.0.0-py
2.7.egg
Processing dependencies for robotframework-selenium2library==1.0.0
Finished processing dependencies for robotframework-selenium2library==1.0.0
Check my system PATH variable
C:\qa_automation_git\pa2> echo %PATH%
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Python27;c:\Python27\Scripts;C:\RobotFramework\Python;C:\RobotFramework\Python\Scripts;
Run pybot on a simple test and it still failed with the decorator module error:
C:\qa_automation_git\pa2>pybot my_login.txt
[ ERROR ] Error in file 'C:\qa_automation_git\pa2\my_keywords.txt' in table
'Settings': Importing test library 'Selenium2Library' failed: ImportError: No m
odule named decorator
PYTHONPATH: ['C:\Python27\lib\site-packages\robot\libraries', 'C:\Python27
\lib\site-packages\setuptools-0.6c11-py2.7.egg', 'C:\Python27\lib\site-pac
kages\robotframework_selenium2library-1.0.0-py2.7.egg', 'C:\WINDOWS\system32
\python27.zip', 'C:\Python27\DLLs', 'C:\Python27\lib', 'C:\Python27\lib\p
lat-win', 'C:\Python27\lib\lib-tk', 'C:\Python27', 'C:\Python27\lib\site-
packages', 'C:\Python27\lib\site-packages\win32', 'C:\Python27\lib\site-p
ackages\win32\lib', 'C:\Python27\lib\site-packages\Pythonwin', '.']
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\robot\utils\importing.py", line 86, in no
n_dotted_import
module = import(name)
File "C:\Python27\lib\site-packages\robotframework_selenium2library-1.0.0-py2.
7.egg\Selenium2Library__init_.py", line 2, in
from keywords import *
File "C:\Python27\lib\site-packages\robotframework_selenium2library-1.0.0-py2.
7.egg\Selenium2Library\keywords__init__.py", line 1, in
from _logging import _LoggingKeywords
File "C:\Python27\lib\site-packages\robotframework_selenium2library-1.0.0-py2.
7.egg\Selenium2Library\keywords_logging.py", line 5, in
from keywordgroup import KeywordGroup
File "C:\Python27\lib\site-packages\robotframework_selenium2library-1.0.0-py2.
7.egg\Selenium2Library\keywords\keywordgroup.py", line 4, in
from decorator import decorator
In the end I fixed the dependencies by doing:
easy_install decorator
easy_install selenium
this issue seems to be caused by an incorrect packaging: you have decorator and selenium listed as dependencies in your setup.py file but there is no requires.txt file inside the EGG-INFO directory of the distribution.
I strongly recommend you to use zest.releaser for this task.
There has not been activity for this issue for few years and we are planning to close the old issues if they are not anymore valid ones. If you feel that this is still valid issue, could you send an update. If update is not received in a month, we will assume that this is not anymore an issues and we will close this issue.
Activity
emanlove commentedon Mar 14, 2012
preshri,
It looks like you need to install the decorator package, http://pypi.python.org/pypi/decorator/3.3.2. I'm not too familiar yet with windows installations but you can use easy_install, if available, or download the source package, from PyPI and install using python. Both methods are documented on the decorator package PyPI website.
Also with the latest 1.0.0 release of robotframework-selenium2library if you install robotframework-selenium2library using easy_install it should also install the necessary dependencies. - Ed
j1z0 commentedon Mar 14, 2012
@preshri how did u install selenium2library?
Harri commentedon Mar 14, 2012
The same thing happened to me on two different machines, both 64 bit Windows 7 (one Enterprise and one Home Premium)
Steps to reproduce:
easy_install does not seem to work with 64 bit Python on Windows (http://pypi.python.org/pypi/setuptools), maybe that is the reason?
Harri commentedon Mar 14, 2012
Same thing happened when installed 32 bit versions of Python, RF and Selenium2Library.
preshri commentedon Mar 14, 2012
@emanlove - The "decorator module not found" issue is not seen now after installing the decorator package, however I am displayed the foll error.
[ ERROR ] Error in file 'D:\py 2.7\Scripts\testRide\testride1.txt' in table 'Settings': Importing test library 'D:/py 2.7/Lib/site-packages/Selenium2Library' failed: ImportError: No module named selenium
PYTHONPATH: ['D:\py 2.7\Lib\site-packages\robot\libraries', 'D:\py 2.7\Lib', 'D:\py 2.7\Scripts', 'D:\py 2.7\Lib\site-packages', 'D:\py 2.7\Lib\site-packages\Selenium2Library', 'D:\py 2.7\Lib\site-packages\robotide', 'D:\py 2.7\Lib\site-packages\wx-2.8-msw-unicode', 'C:\WINNT\system32\python27.zip', 'D:\py 2.7\DLLs', 'D:\py 2.7\lib\plat-win', 'D:\py 2.7\lib\lib-tk', 'D:\py 2.7', 'D:\py 2.7\Lib\site-packages\robot', '.']
Traceback (most recent call last):
File "D:\py 2.7\Lib\site-packages\robot\utils\importing.py", line 84, in non_dotted_import
module = import_module_by_path(name)
File "D:\py 2.7\Lib\site-packages\robot\utils\importing.py", line 38, in import_module_by_path
module = import(modname)
File "D:\py 2.7\Lib\site-packages\Selenium2Library__init.py", line 2, in
from keywords import *
File "D:\py 2.7\Lib\site-packages\Selenium2Library\keywords__init_.py", line 3, in
from _browsermanagement import _BrowserManagementKeywords
File "D:\py 2.7\Lib\site-packages\Selenium2Library\keywords_browsermanagement.py", line 4, in
from selenium import webdriver
@j1z0 - I installed Selenium2 library using the Windows installer "robotframework-selenium2library-1.0.0.win32.exe" and have imported the path to the test suite e.g. D:/py 2.7/Lib/site-packages/Selenium2Library
j1z0 commentedon Mar 14, 2012
the windows installer doesn't package all the dependencies.... we can look into it doing that... the best solution is
pip install Selenium2Library. if you do that it will install all dependencies for you, including selenium, robot framework, decorator and whatever else.
emanlove commentedon Mar 14, 2012
preshri, so building off of j1z0 comments about the windows install vs. installing using "pip install Selenium2Library", you will need to also install the selenium package.
@j1z0,@rtomac, @Myself - we might need to change the documentation so to reflect this more clearly. Also I thinking we might need a small pip/easy_install tutorial; like how to upgrade or pull a specific version.
emanlove commentedon Mar 14, 2012
Concerning python's packaging tools there are two with very similar names, distutils and Distribute, but with different functionality. Distribute apparently is an upgrade and performs much better across platforms. There currently is an issue with installing robotframework on Linux using buildout (another "python-based configuration-driven build tool") which I am looking into and because it involves python packaging I will see about limitations for Win 64 bit.
Harri commentedon Mar 14, 2012
In case somebody else is wondering how to get started on Windows (64 bit or not), this is how I got things going:
elizaleong commentedon Mar 20, 2012
I followed Harri's steps on a 32-bit windows machine. It didn't fix the decorator module error for me, but easy_install (picked up in step 2) came in handy.
My steps and results:
C:\qa_automation_git\pa2>python ez_setup.py
Downloading http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-p
y2.7.egg
Processing setuptools-0.6c11-py2.7.egg
Copying setuptools-0.6c11-py2.7.egg to c:\python27\lib\site-packages
Adding setuptools 0.6c11 to easy-install.pth file
Installing easy_install-script.py script to C:\Python27\Scripts
Installing easy_install.exe script to C:\Python27\Scripts
Installing easy_install.exe.manifest script to C:\Python27\Scripts
Installing easy_install-2.7-script.py script to C:\Python27\Scripts
Installing easy_install-2.7.exe script to C:\Python27\Scripts
Installing easy_install-2.7.exe.manifest script to C:\Python27\Scripts
Installed c:\python27\lib\site-packages\setuptools-0.6c11-py2.7.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11
C:>easy_install robotframework-selenium2library
Processing robotframework-selenium2library
Running rtomac-robotframework-selenium2library-893dc2c\setup.py -q bdist_egg --d
ist-dir C:\robotframework-selenium2library\rtomac-robotframework-selenium2librar
y-893dc2c\egg-dist-tmp-krzthy
warning: no previously-included files found matching '_.rst'
warning: no files found matching '.rst' under directory 'demo'
warning: no files found matching '.sh' under directory 'demo'
warning: no files found matching '.bat' under directory 'demo'
warning: no files found matching '_.js' under directory 'demo'
no previously-included directories found matching 'demo\reports'
no previously-included directories found matching 'demo\selenium_log.txt'
no previously-included directories found matching 'demo\output.xml'
warning: no previously-included files matching '*.pyc' found under directory 'sr
c'
zip_safe flag not set; analyzing archive contents...
ez_setup: module MAY be using inspect.getsourcefile
Selenium2Library.init: module references file
Selenium2Library.keywords._browsermanagement: module references file
Adding robotframework-selenium2library 1.0.0 to easy-install.pth file
Installed c:\python27\lib\site-packages\robotframework_selenium2library-1.0.0-py
2.7.egg
Processing dependencies for robotframework-selenium2library==1.0.0
Finished processing dependencies for robotframework-selenium2library==1.0.0
C:\qa_automation_git\pa2> echo %PATH%
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Python27;c:\Python27\Scripts;C:\RobotFramework\Python;C:\RobotFramework\Python\Scripts;
Run pybot on a simple test and it still failed with the decorator module error:
C:\qa_automation_git\pa2>pybot my_login.txt
[ ERROR ] Error in file 'C:\qa_automation_git\pa2\my_keywords.txt' in table
'Settings': Importing test library 'Selenium2Library' failed: ImportError: No m
odule named decorator
PYTHONPATH: ['C:\Python27\lib\site-packages\robot\libraries', 'C:\Python27
\lib\site-packages\setuptools-0.6c11-py2.7.egg', 'C:\Python27\lib\site-pac
kages\robotframework_selenium2library-1.0.0-py2.7.egg', 'C:\WINDOWS\system32
\python27.zip', 'C:\Python27\DLLs', 'C:\Python27\lib', 'C:\Python27\lib\p
lat-win', 'C:\Python27\lib\lib-tk', 'C:\Python27', 'C:\Python27\lib\site-
packages', 'C:\Python27\lib\site-packages\win32', 'C:\Python27\lib\site-p
ackages\win32\lib', 'C:\Python27\lib\site-packages\Pythonwin', '.']
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\robot\utils\importing.py", line 86, in no
n_dotted_import
module = import(name)
File "C:\Python27\lib\site-packages\robotframework_selenium2library-1.0.0-py2.
7.egg\Selenium2Library__init_.py", line 2, in
from keywords import *
File "C:\Python27\lib\site-packages\robotframework_selenium2library-1.0.0-py2.
7.egg\Selenium2Library\keywords__init__.py", line 1, in
from _logging import _LoggingKeywords
File "C:\Python27\lib\site-packages\robotframework_selenium2library-1.0.0-py2.
7.egg\Selenium2Library\keywords_logging.py", line 5, in
from keywordgroup import KeywordGroup
File "C:\Python27\lib\site-packages\robotframework_selenium2library-1.0.0-py2.
7.egg\Selenium2Library\keywords\keywordgroup.py", line 4, in
from decorator import decorator
In the end I fixed the dependencies by doing:
easy_install decorator
easy_install selenium
Now pybot runs as expected.
hvelarde commentedon Nov 27, 2012
this issue seems to be caused by an incorrect packaging: you have decorator and selenium listed as dependencies in your setup.py file but there is no requires.txt file inside the EGG-INFO directory of the distribution.
I strongly recommend you to use zest.releaser for this task.
hvelarde commentedon Nov 28, 2012
you may also take a look at your MANIFEST.in file: it's so complicated that it should be buggy...
Raptor399 commentedon Dec 15, 2012
For completeness sake, I would like to add another use case.
I am using this pom.xml:
Running
mvn verifyI get the exact same messageImportError: No module named decorator.In this scenario it is not possible to install extra libraries as discussed above because the Maven plugin will use a prepackaged jython.jar.
saji-v commentedon Sep 2, 2015
Try installing decorator from https://pypi.python.org/pypi/decorator
aaltat commentedon Nov 5, 2015
There has not been activity for this issue for few years and we are planning to close the old issues if they are not anymore valid ones. If you feel that this is still valid issue, could you send an update. If update is not received in a month, we will assume that this is not anymore an issues and we will close this issue.
aaltat commentedon Dec 10, 2015
Closed because of inactivity. If someone encounters similar or same problem please open a new issue.