Automation not finding service for python script available in Developer Services page

I have an automation as shown below:

  alias: 'sunrise_launcher'
  trigger:
    - platform: sun
      event: sunrise
#     offset: '00:20:00'
  action:
    - service: notify.notify
      data:
        message: 'fake sunrise begins.'
        target: ["email/[email protected]"]
#    - delay: '00:20:00'
    - service: python_script.sunrise_script 

There are no errors found when I check configuration. And when I trigger the automation I see the automation launched in the logs. Then I get the email notification almost immediately. The python script does not run.

In the website developers console I see the error:

Unable to find service python_script./sunrise_script

But then under the services section of the developers console I can call up the service

python_script.sunrise_script

and I can use that service to run my python script.

A nearly identical python script runs as expected from another automation. Both the non- working and the working python scripts are in the /.homeassistant/python_scripts folder. I’ve copied the service call line in my automation from the working python script automation and the script name from the Developers Console.

I’m inclined to think it’s a bug. But it could easily be some silly error on my part. Anyone have any ideas?

you have to put in python_script: location of the python script in configuration.yaml

It’s there. If it was not my other python script would not run (it does) and the sunrise_script would not show up in the developers console under services.

It appears that the last time i did a system upgrade I was not in the Python Virtual Environment