robotframework-faker
robotframework-faker copied to clipboard
Unable detect the fakerlibrary
Why I will encounter this issue after executing command below?
python -m faker /usr/bin/python: No module named faker
Hey @xyngfei , can you give me some more information? What steps did you follow to install your dependencies? What is the output of pip list
?
@guykisel
Here is this...
> pyobjc-framework-WebKit 2.5.1
> pyOpenSSL 0.13.1
> pyparsing 2.0.1
> python-dateutil 1.5
> pytz 2013.7
> requests 2.18.4
> robotframework 3.0.2
> robotframework-databaselibrary 1.0.1
> **robotframework-faker 4.2.0**
> robotframework-jsonlibrary 0.2
> robotframework-requests 0.4.7
> robotframework-selenium2library 1.8.0
> scipy 0.13.0b1
> selenium 3.5.0
ip-xxx:spec_functional xyngfei$ sudo pip install -U robotframework-faker
The directory '/Users/xyngfei/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/xyngfei/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting robotframework-faker
Downloading robotframework_faker-4.2.0-py2.py3-none-any.whl
Requirement already up-to-date: robotframework in /Library/Python/2.7/site-packages (from robotframework-faker)
Collecting faker (from robotframework-faker)
Downloading Faker-0.8.3-py2.py3-none-any.whl (629kB)
100% |████████████████████████████████| 634kB 1.7MB/s
Collecting wrapt (from robotframework-faker)
Downloading wrapt-1.10.11.tar.gz
Collecting python-dateutil>=2.4 (from faker->robotframework-faker)
Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)
100% |████████████████████████████████| 194kB 2.8MB/s
Collecting email-validator==1.0.2 (from faker->robotframework-faker)
Downloading email_validator-1.0.2-py2.py3-none-any.whl
Requirement already up-to-date: ipaddress; python_version == "2.7" in /Library/Python/2.7/site-packages (from faker->robotframework-faker)
Collecting six (from faker->robotframework-faker)
Downloading six-1.10.0-py2.py3-none-any.whl
Collecting dnspython>=1.15.0 (from email-validator==1.0.2->faker->robotframework-faker)
Downloading dnspython-1.15.0-py2.py3-none-any.whl (177kB)
100% |████████████████████████████████| 184kB 2.4MB/s
Requirement already up-to-date: idna>=2.0.0 in /Library/Python/2.7/site-packages (from email-validator==1.0.2->faker->robotframework-faker)
Installing collected packages: six, python-dateutil, dnspython, email-validator, faker, wrapt, robotframework-faker
Found existing installation: six 1.4.1
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
copy2(src, real_dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
copystat(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/tmp/pip-S9SOm_-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
ip-xxx:spec
End up i only can use the command below to install
sudo pip install -U --ignore-installed six robotframework-faker
Can i confirm does it have any configuration issue on my mac machine?
can you try installing to a virtualenv? http://docs.python-guide.org/en/latest/dev/virtualenvs/
it's usually not a good idea to install things globally.
I face the same issue.
Meanwhile python -m faker
lists all faker methods.
I use this setup:
(rf_demo) markus@markus-VirtualBox:~/mbo-rfdemo$ pip list
Package Version
-------------------- -------
Faker 0.9.0
ipaddress 1.0.22
pip 18.0
Pypubsub 4.0.0
python-dateutil 2.7.3
robotframework 3.0.4
robotframework-faker 4.2.0
setuptools 40.0.0
six 1.11.0
text-unidecode 1.2
typing 3.6.4
wheel 0.31.1
wrapt 1.10.11
When I execute the following testcase
*** Settings ***
Library OperatingSystem
Library FakerLibrary
*** Test Cases ***
Verzeichnis soll nicht leer sein
[Documentation] Verzeichnis darf nicht leer sein.
[Tags] verzeichnis
${Files}= Anzahl Dateien im Windows-Verzeichnis
Should Not Be Equal As Numbers 0 ${Files}
Wort Generator
${words}= FakerLibrary.Words
Log words: ${words}
${words}= FakerLibrary.Words nb=${10}
Log words: ${words}
*** Keywords ***
Anzahl Dateien im Windows-Verzeichnis
${Anzahl}= Count Files In Directory .
Log ${Anzahl}
[Return] ${Anzahl}
I get
[ ERROR ] Error in file '/home/markus/mbo-rfdemo/dir.robot': Importing test library 'FakerLibrary' failed: ImportError: No module named FakerLibrary
Traceback (most recent call last):
None
PYTHONPATH:
/home/markus/.local/bin
/usr/lib/python2.7
/usr/lib/python2.7/plat-x86_64-linux-gnu
/usr/lib/python2.7/lib-tk
/usr/lib/python2.7/lib-old
/usr/lib/python2.7/lib-dynload
/home/markus/.local/lib/python2.7/site-packages
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages
I face the same issue. Meanwhile
python -m faker
lists all faker methods.I use this setup:
(rf_demo) markus@markus-VirtualBox:~/mbo-rfdemo$ pip list Package Version -------------------- ------- Faker 0.9.0 ipaddress 1.0.22 pip 18.0 Pypubsub 4.0.0 python-dateutil 2.7.3 robotframework 3.0.4 robotframework-faker 4.2.0 setuptools 40.0.0 six 1.11.0 text-unidecode 1.2 typing 3.6.4 wheel 0.31.1 wrapt 1.10.11
When I execute the following testcase
*** Settings *** Library OperatingSystem Library FakerLibrary *** Test Cases *** Verzeichnis soll nicht leer sein [Documentation] Verzeichnis darf nicht leer sein. [Tags] verzeichnis ${Files}= Anzahl Dateien im Windows-Verzeichnis Should Not Be Equal As Numbers 0 ${Files} Wort Generator ${words}= FakerLibrary.Words Log words: ${words} ${words}= FakerLibrary.Words nb=${10} Log words: ${words} *** Keywords *** Anzahl Dateien im Windows-Verzeichnis ${Anzahl}= Count Files In Directory . Log ${Anzahl} [Return] ${Anzahl}
I get
[ ERROR ] Error in file '/home/markus/mbo-rfdemo/dir.robot': Importing test library 'FakerLibrary' failed: ImportError: No module named FakerLibrary Traceback (most recent call last): None PYTHONPATH: /home/markus/.local/bin /usr/lib/python2.7 /usr/lib/python2.7/plat-x86_64-linux-gnu /usr/lib/python2.7/lib-tk /usr/lib/python2.7/lib-old /usr/lib/python2.7/lib-dynload /home/markus/.local/lib/python2.7/site-packages /usr/local/lib/python2.7/dist-packages /usr/lib/python2.7/dist-packages
Its working fine now? I have the same issue and cannot fix.
@guykisel @laurentbristiel
Any update on the above issues? I try to install the latest release and the library still undetected
I can't use keywords like Name
etc
pip list
output
Faker 8.9.1
robotframework-faker 5.0.0
Hello, I just re-tried the latest versions of robotframework and robotframework-faker and it works OK for me. Maybe there is a mix in your environment between python2 and python3.
If you want to work with Python3, could you do:
- python3 -m pip install robotframework-faker
- python3 -p pip freeze <= to check the install was done OK
- python3 import robotframework-faker
=> doing so, ensure that you do everything with Python 3
@guykisel @laurentbristiel
Any update on the above issues? I try to install the latest release and the library still undetected I can't use keywords like
Name
etc
Were you able to fix this bug? I have the exact same one. I don't see keywords. But it's working.
I only see these keywords