avinassh / rockstar

Makes you a Rockstar C++ Programmer in 2 minutes
MIT License
4.19k stars 282 forks source link

cannot import name 'Rockstar' from partially initialized module 'rockstar' #98

Closed gautamhans1 closed 3 years ago

gautamhans1 commented 5 years ago

ImportError: cannot import name 'RockStar' from partially initialized module 'rockstar' (most likely due to a circular import)

pcaversaccio commented 3 years ago

This happens if you name a python file the same name as a dependency your project uses. Thus, if you saved the following lines as rockstar.py it won't work:

from rockstar import RockStar

rock_it_bro = RockStar(days=300)
rock_it_bro.make_me_a_rockstar()

Rename the file and it will compile.

avinassh commented 3 years ago

@pcaversaccio thank you! I guess thats what was happening.