lk-geimfari / mimesis

Mimesis is a robust data generator for Python that can produce a wide range of fake data in multiple languages.
https://mimesis.name
MIT License
4.34k stars 326 forks source link

Cannot import Person from partially initialized module. #1565

Open lk-geimfari opened 3 weeks ago

lk-geimfari commented 3 weeks ago

This error occurs when installing Mimesis manually from a wheel or archive.

image

Steps to reproduce this error:

  1. Create new virtual environment with Python 3.12
  2. Download Poetry Core v1.9.0 and mimesis v17 from pypi.org
  3. pip install poetry core
  4. pip install mimesis
  5. Run environment in Pycharm and VS and get the same error.
lk-geimfari commented 3 weeks ago

Using relative imports instead of absolute ones should fix it. Therefore, it may be a good idea to use only relative import of local modules.

lk-geimfari commented 3 weeks ago

@acobb83 Just so you know, I'm not going to ignore this issue. I'll fix this problem as soon as I have a little more free time at my job. Thank you for bringing this to my attention.

P.S If you're interested in contributing, you can fix it on your own and send me a Pull Request.