Duolingo icon indicating copy to clipboard operation
Duolingo copied to clipboard

module 'duolingo' has no attribute 'Duolingo'

Open m-herzberg opened this issue 2 years ago • 4 comments

Please help me with this problem :((

"AttributeError: module 'duolingo' has no attribute 'Duolingo'" when I run the sample code from Your repository...

m-herzberg avatar Sep 07 '22 13:09 m-herzberg

Please help me with this problem :((

"AttributeError: module 'duolingo' has no attribute 'Duolingo'" when I run the sample code from Your repository...

Can it be that you named your file duolingo.py? In this case import duolingo line imports your local file instead of the duolingo library.

igorskh avatar Sep 07 '22 13:09 igorskh

thanks!

m-herzberg avatar Sep 07 '22 15:09 m-herzberg

Hi, love the work you have put in to this, would like to use it in my personal projects.

But I have the same problem, i have checkt to not have my file named like he does.

When i try: from duolingo import Duolingo it references to the path as aspected as shown in the error text: ImportError: cannot import name 'Duolingo' from 'duolingo' (/Users/Niels/anaconda3/lib/python3.8/site-packages/duolingo/init.Python) So its not the problem Igorskh had.

When i just do it like in the documentation i get the same error as above: AttributeError: module 'duolingo' has no attribute 'Duolingo'

Could you please tell me what im doing wrong here..

Many thanks!

NielsDotGithub avatar Dec 28 '22 16:12 NielsDotGithub

For me it was because I had a pip package installed under the name duolingo, which took precedence over the package duolingo-api when importing the module with name duolingo. Removing the package fixed it.

rhlee avatar Jan 04 '23 20:01 rhlee