简体   繁体   中英

Error: ModuleNotFoundError: No module named 'DataSynthesizer'

I'm using the DataSynthesizer package. I installed it. When using it in my code as follows:

from DataDescriber import DataDescriber

I get the error:

~\AppData\Local\Programs\Python\Python39\Lib\site-packages\DataSynthesizer\DataDescriber.py in <module>
      5 from pandas import DataFrame, read_csv
      6 
----> 7 from DataSynthesizer.datatypes.AbstractAttribute import AbstractAttribute
      8 from DataSynthesizer.datatypes.DateTimeAttribute import is_datetime, DateTimeAttribute
      9 from DataSynthesizer.datatypes.FloatAttribute import FloatAttribute

ModuleNotFoundError: No module named 'DataSynthesizer'

The error is in DataDescriber.py, not in my code. I tried to install the package in different ways, but the error still exists.

I think it's the way you're trying to import it. You're trying to import DataDescriber from DataDescriber, instead of importing DataDescriber from the module itself. If you do "from DataSynthesizer import DataDescriber" it should work, as it did for me. If it still does not work, try using PipEnv to isolate it from other module interference.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM