Skip to content
Youngho Chaa cha cha

Partially initialised module in Python

python1 min read

I was trying to run my python script has had been running well but kept getting an error after I renamed a file to signal

File "/Users/andrew/github/buy-sell-signals/src/decide-buysell/", line 16, in <module>
yfTicker = yf.Ticker(ticker)
AttributeError: partially initialized module 'yfinance' has no attribute 'Ticker' (most likely due to a circular import)

It turned out that it was because the file name collided with a name of an imported module. Python saw the local file and thought it was the module. So be careful not to name your file too generic!

© 2024 by Youngho Chaa cha cha. All rights reserved.
Theme by LekoArts