Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing test library 'FakerLibrary' failed: AttributeError: 'PosixPath' object has no attribute 'startswith' #71

Open
nixuewei opened this issue Jun 16, 2021 · 0 comments

Comments

@nixuewei
Copy link

Python:3.8.10,robotframework-faker=5.0.0, import to RIDE

20210616 10:14:24.262 [WARN]: Importing test library "FakerLibrary" failed

Traceback (most recent call last):
Importing test library 'FakerLibrary' failed: AttributeError: 'PosixPath' object has no attribute 'startswith'
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/robotide/lib/robot/utils/importer.py", line 153, in _import
return import(name, fromlist=fromlist)
File "/Users/ming.ni/Library/Python/3.8/lib/python/site-packages/FakerLibrary/init.py", line 2, in
from .keywords import FakerKeywords
File "/Users/ming.ni/Library/Python/3.8/lib/python/site-packages/FakerLibrary/keywords.py", line 10, in
import faker.factory
File "/Users/ming.ni/Library/Python/3.8/lib/python/site-packages/faker/init.py", line 1, in
from faker.factory import Factory
File "/Users/ming.ni/Library/Python/3.8/lib/python/site-packages/faker/factory.py", line 7, in
from faker.config import AVAILABLE_LOCALES, DEFAULT_LOCALE, PROVIDERS
File "/Users/ming.ni/Library/Python/3.8/lib/python/site-packages/faker/config.py", line 11, in
PROVIDERS = find_available_providers(
File "/Users/ming.ni/Library/Python/3.8/lib/python/site-packages/faker/utils/loading.py", line 57, in find_available_providers
for mod in list_module(providers_mod) if mod != 'pycache'
File "/Users/ming.ni/Library/Python/3.8/lib/python/site-packages/faker/utils/loading.py", line 35, in list_module
return [name for _, name, is_pkg in pkgutil.iter_modules([path]) if is_pkg]
File "/Users/ming.ni/Library/Python/3.8/lib/python/site-packages/faker/utils/loading.py", line 35, in
return [name for _, name, is_pkg in pkgutil.iter_modules([path]) if is_pkg]
File "/usr/local/Cellar/[email protected]/3.8.10/Frameworks/Python.framework/Versions/3.8/lib/python3.8/pkgutil.py", line 129, in iter_modules
for i in importers:
File "/usr/local/Cellar/[email protected]/3.8.10/Frameworks/Python.framework/Versions/3.8/lib/python3.8/pkgutil.py", line 419, in get_importer
importer = path_hook(path_item)
File "", line 1594, in path_hook_for_FileFinder
File "", line 1469, in init
File "", line 177, in _path_isabs
PYTHONPATH:
/Users/ming.ni/Documents
/Users/ming.ni/Documents/testframework/Resources
/Users/ming.ni/Documents
/Users/ming.ni/Documents/testframework/Resources
/Users/ming.ni/Documents
/Users/ming.ni/Documents/testframework/Resources
/Users/ming.ni/Documents
/Users/ming.ni/Documents/testframework/Resources
/Users/ming.ni/Documents
/Users/ming.ni/Documents/testframework/Resources
/Users/ming.ni/Documents
/Users/ming.ni/Documents/testframework/Resources
/Users/ming.ni/Documents
/Users/ming.ni/Documents/testframework/Resources
/Users/ming.ni/Documents
/Users/ming.ni/Documents/testframework/Resources
/Users/ming.ni/Documents/testframework/Resources
/Users/ming.ni/Documents
/Users/ming.ni/Documents/testframework/Resources
/Users/ming.ni/Documents
/Users/ming.ni/Documents/testframework/Resources
/Users/ming.ni/Documents
/Users/ming.ni/Documents/testframework/Resources
/Users/ming.ni/Documents
/usr/local/bin
/usr/local/Cellar/[email protected]/3.8.10/Frameworks/Python.framework/Versions/3.8/lib/python38.zip
/usr/local/Cellar/[email protected]/3.8.10/Frameworks/Python.framework/Versions/3.8/lib/python3.8
/usr/local/Cellar/[email protected]/3.8.10/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload
/Users/ming.ni/Library/Python/3.8/lib/python/site-packages
/usr/local/lib/python3.8/site-packages
/usr/local/lib/python3.8/site-packages/robotide/spec
/usr/local/lib/python3.8/site-packages/robotide/lib
/usr/local/lib/python3.8/site-packages/robotide/contrib/testrunner/../../lib
/usr/local/lib/python3.8/site-packages/robotide/contrib/testrunner/../../lib
File "/usr/local/lib/python3.8/site-packages/robotide/spec/librarymanager.py", line 82, in _fetch_keywords
return get_import_result(path, library_args)
File "/usr/local/lib/python3.8/site-packages/robotide/spec/libraryfetcher.py", line 21, in get_import_result
lib = robotapi.TestLibrary(path, args)
File "/usr/local/lib/python3.8/site-packages/robotide/lib/robot/running/testlibraries.py", line 49, in TestLibrary
libcode, source = importer.import_class_or_module(import_name,
File "/usr/local/lib/python3.8/site-packages/robotide/lib/robot/utils/importer.py", line 72, in import_class_or_module
self._raise_import_failed(name, err)
File "/usr/local/lib/python3.8/site-packages/robotide/lib/robot/utils/importer.py", line 109, in _raise_import_failed
raise DataError('\n'.join(msg))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant