alexsilva / supervisor

Supervisor process control system for Windows
http://supervisord.org
Other
118 stars 26 forks source link

TypeError: main() missing 1 required positional argument: 'argv' when installing as a Windows service ( install from the utility script) #42

Closed devinyasas1 closed 2 years ago

devinyasas1 commented 2 years ago

Added this as a PATH under env variables. C:\Users\ACER\AppData\Local\Programs\Python\Python37-32\Scripts

Then as in the documentation then I executed this command, supervisor_service.exe install -c C:\Users\ACER\AppData\Local\Programs\Python\Python37-32\Scripts\\supervisord.conf

But it gave me this error,

File "C:\xampp\htdocs\pdf_tron_service\venv\Scripts\supervisor_service-script.py", line 11, in load_entry_point('supervisor-win==4.6.0', 'console_scripts', 'supervisor_service')() TypeError: main() missing 1 required positional argument: 'argv'

Here's the code from _supervisorservice-script.py

#!c:\xampp\htdocs\pdf_tron_service\venv\scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'supervisor-win==4.6.0','console_scripts','supervisor_service'
__requires__ = 'supervisor-win==4.6.0'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('supervisor-win==4.6.0', 'console_scripts', 'supervisor_service')()
    )

Before go further, What did I do wrong?

alexsilva commented 2 years ago

There was a problem in the code but it has now been fixed. https://github.com/alexsilva/supervisor/commits/windows

Did you install again ? python -m pip install git+https://github.com/alexsilva/supervisor@windows

devinyasas1 commented 2 years ago

There was a problem in the code but it has now been fixed. https://github.com/alexsilva/supervisor/commits/windows

Did you install again ? python -m pip install git+https://github.com/alexsilva/supervisor@windows

Thanks. So I created supervisord.conf file inside the following directory and executed this command python -m supervisor.services install -c C:\supervisor\\supervisord.conf

Then it showed me this message,

Installing service Supervisor Pyv3.7-32
Changing service configuration
Service updated

Then I started process from services and it generated service log file. I attached the file.

logfile contains this:

2022-04-28 13:28:42,615 [INFO] supervisor config path: C:\supervisor\supervisord.conf 2022-04-28 13:28:43,283 [INFO] supervisor starting... 2022-04-28 13:28:43,287 [ERROR] Error: .ini file does not include supervisord section 2022-04-28 13:28:43,287 [ERROR] For help, use C:\xampp\htdocs\pdf_tron_service\venv\Scripts\supervisor_service -h

However Also There was nothing inside supervisord.conf file. In Linux it filled with paths and commands

alexsilva commented 2 years ago

How did you create the file supervisord.conf ? The way I know to create this file is using the executable echo_supervisord_conf. creating-a-configuration-file