N
N
Nolrox2022-01-12 20:25:47
Python
Nolrox, 2022-01-12 20:25:47

What to do if python does not import Faker?

When i run the code file

from faker import Faker

faker = Faker()

print(f'{faker.first_name()} {faker.last_name()}\n\n')

print(f'{faker.name_male()}')
print(f'{faker.name_female()}')

outputs the error
"Traceback (most recent call last):
File "faker.py", line 1, in
from faker import Faker
File "faker.py", line 1, in
from faker import Faker
ImportError: cannot import name 'Faker ' from 'faker'"
As far as I understand it cannot import Faker from the "faker" library. What to do, how to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2022-01-12
@Nolrox

don't name your script faker.py

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question