[ BUG ] AttributeError: 'PosixPath' object has no attribute 'startswith'
LordRonz opened this issue · 1 comments
LordRonz commented
Describe the Bug
This error occured when I update my python and importing Hentai
Steps To Reproduce
When I try to run
from hentai import Hentai
The error occured
System Information
OS Name | Build No. | Python Version | App Version |
---|---|---|---|
Arch Linux |
5.10.30-1-lts |
3.9.5 |
`` |
Error message & warnings
```bash
Traceback (most recent call last):
File "/usr/lib/python3.9/pkgutil.py", line 416, in get_importer
importer = sys.path_importer_cache[path_item]
KeyError: PosixPath('/home/lordronz/.local/lib/python3.9/site-packages/faker/providers')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/lordronz/.local/lib/python3.9/site-packages/hentai/__init__.py", line 5, in <module>
from .hentai import *
File "/home/lordronz/.local/lib/python3.9/site-packages/hentai/hentai.py", line 45, in <module>
from faker import Faker
File "/home/lordronz/.local/lib/python3.9/site-packages/faker/__init__.py", line 1, in <module>
from faker.factory import Factory
File "/home/lordronz/.local/lib/python3.9/site-packages/faker/factory.py", line 7, in <module>
from faker.config import AVAILABLE_LOCALES, DEFAULT_LOCALE, PROVIDERS
File "/home/lordronz/.local/lib/python3.9/site-packages/faker/config.py", line 11, in <module>
PROVIDERS = find_available_providers(
File "/home/lordronz/.local/lib/python3.9/site-packages/faker/utils/loading.py", line 57, in find_available_providers
for mod in list_module(providers_mod) if mod != '__pycache__'
File "/home/lordronz/.local/lib/python3.9/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 "/home/lordronz/.local/lib/python3.9/site-packages/faker/utils/loading.py", line 35, in <listcomp>
return [name for _, name, is_pkg in pkgutil.iter_modules([path]) if is_pkg]
File "/usr/lib/python3.9/pkgutil.py", line 130, in iter_modules
for i in importers:
File "/usr/lib/python3.9/pkgutil.py", line 420, in get_importer
importer = path_hook(path_item)
File "<frozen importlib._bootstrap_external>", line 1601, in path_hook_for_FileFinder
File "<frozen importlib._bootstrap_external>", line 1476, in __init__
File "<frozen importlib._bootstrap_external>", line 177, in _path_isabs
AttributeError: 'PosixPath' object has no attribute 'startswith'
Code samples
from hentai import Hentai
Expected behavior
Successfully imported
Additional context
None
LordRonz commented
My bad, the problem is the faker package. Updating faker fixed it