PrithivirajDamodaran / Parrot_Paraphraser

A practical and feature-rich paraphrasing framework to augment human intents in text form to build robust NLU models for conversational engines. Created by Prithiviraj Damodaran. Open to pull requests and other forms of collaboration.
Apache License 2.0
866 stars 141 forks source link

ImportError: cannot import name 'Parrot' from partially initialized module 'parrot' (most likely due to a circular import) (D:\python\paraphrase\parrot.py) #44

Open hasan-araav opened 1 year ago

hasan-araav commented 1 year ago

I am getting this issue. I have installed Parrot corectly but stil showing this eeor. Pls help.

PrithivirajDamodaran commented 1 year ago

I added a new demo notebook, and everything works fine. (check for the link in Readme)

yadhuvarshini commented 1 year ago

I am facing same issue while working in local , Please help me

qaixerabbas commented 1 year ago

@hasan-araav Rename your Python file from "parrot.py" to something else. As the library name is also parrot so Python Interpreter is throwing circular import error.

susandong commented 1 year ago

change parrot to parrot.parrot works

snow00726 commented 10 months ago

I also encountered this problem, this is the problem description:ImportError: cannot import name 'Parrot' from 'parrot' (D:\Python\Anaconda\envs\nlp_env\lib\site-packages\parrot\init.py), how can I solve it?

qaixerabbas commented 10 months ago

@snow00726 make sure you have installed the library. From the error message, it seems that there could be a version mismatch error. Try to uninstall and install it again in a virtual environment.

snow00726 commented 10 months ago

@snow00726 make sure you have installed the library. From the error message, it seems that there could be a version mismatch error. Try to uninstall and install it again in a virtual environment.

The requirements.txt file requires downloading parrot-1.0, but I can't find parrot 1.0 in pypi. I've downloaded parrot 0.0.16, but it doesn't seem to work, it still reports the same error.

qaixerabbas commented 10 months ago

@snow00726 Do not install from the PyPI, I guess that could be the error.

For a fresh install please

  1. Create a new virtual environment
  2. activate it
  3. and then run the following command

pip install git+https://github.com/PrithivirajDamodaran/Parrot_Paraphraser.git

This should work. I just tested and it is working perfectly for me.

snow00726 commented 10 months ago

@snow00726 Do not install from the PyPI, I guess that could be the error.

For a fresh install please

  1. Create a new virtual environment
  2. activate it
  3. and then run the following command

pip install git+https://github.com/PrithivirajDamodaran/Parrot_Paraphraser.git

This should work. I just tested and it is working perfectly for me.

Thank you! It works for me.

qaixerabbas commented 10 months ago

@snow00726 I am glad to hear this.

VinayWaingankar97 commented 4 months ago

pip install git+https://github.com/PrithivirajDamodaran/Parrot_Paraphraser.git

after installing this, still it is not working.

qaixerabbas commented 4 months ago

@VinayWaingankar97 test it with a new virtual environment.