ImportError: No module named Selenium2Library
I am quite new to Robot Framework and I could use some help.
I'm using Ubuntu 14. And I have installed Robot following these steps:
# Python package management tool pip.
sudo apt-get install python2.7-dev
sudo apt-get install python-setuptools
sudo apt-get install python-pip
# wxPython
sudo apt-get install python-wxgtk2.8
sudo apt-get install python-wxversion
# Setting up actual robotframework + ide + selenium library.
sudo pip install robotframework
sudo pip install robotframework-ride
sudo pip install robotframework-seleniumlibrary
I use python ride.py
(or sudo python ride.py
) and the framework runs.
Also some simple tests run. But in other cases I get errors because of library dependencies, eg: ImportError: No module named Selenium2Library
(but also others)
When I install the libraries (using sudo -H pip install robotframework-selenium2library
) I get the following:
Requirement already satisfied (use --upgrade to upgrade): robotframework-selenium2library in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): decorator>=3.3.2 in /usr/local/lib/python2.7/dist-packages (from robotframework-selenium2library)
Requirement already satisfied (use --upgrade to upgrade): selenium>=2.32.0 in /usr/local/lib/python2.7/dist-packages (from robotframework-selenium2library)
Requirement already satisfied (use --upgrade to upgrade): robotframework>=2.6.0 in /usr/local/lib/python2.7/dist-packages (from robotframework-selenium2library)
Requirement already satisfied (use --upgrade to upgrade): docutils>=0.8.1 in /usr/local/lib/python2.7/dist-packages (from robotframework-selenium2library)
Cleaning up...
So it looks like the libraries are installed, but are not seen. Do you believe is permissions? Do you think they should be installed in specific directory so that they can be accessed?
Any idea is welcome! Thank you in advance :)
Solution 1:
I had to enable the library for my own user. The flag: --user
, did the trick for me.
sudo pip uninstall robotframework-selenium2library
pip install --user robotframework-selenium2library
But without first uninstalling it, I would get requirement already satisfied
message.