Python - Importing YFinance using task scheduler crashes the program, but when running through Spyder it works fine

Viewed 13

Background: Hi All. New to programing here. I am developing a algorithm that periodically checks stock data using YFinance, and then send an update email to specified inboxes. The next iteration I am developing I would like to run at specific times during the day, and using Windows Task Scheduler appears to be the best way, and the approach I am taking to do so.

Description of issue: When running the algorithm using Spyder and pressing the "Play" button, the algorithm works perfect. When I use Task Scheduler, it crashes when it gets to the line "import yfinance as YF" I receive error code 0x2. I am uncertain what is going wrong. Any help is appreciated, Thanks.

0 Answers
Related