You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running python -m supervisor.services (remove or install)
ModuleNotFoundError errors are raised, e.g.
ModuleNotFoundError: No module named 'servicemanager'
ModuleNotFoundError: No module named 'getopt'
NOTE:
To me it looks like that the problems are caused by the pywin32 package (i.e. pywin32 bugs or how pywin32 is used in supervisor-win).
--> this issue might end up as "WONTFOX" but I'll document my findings here anyway for the others who might have the same problem.
There are several scenarios where this happens
Scenario-1: virtualenv & supervisor-win as depency to "develop" install
Steps to reprocude:
0) create and activate a python virtualenv
in new python package ("my_package") define supervisor-win as dependency i.e.
install that "my_package" in "develop" mode (i.e. python setup.py develop)
i.e. after this pip list shows my package
> pip list
Package Version Location
------------------ ---------- -----------------
my_package 0.0.0.dev1 path\to\my_package\src
run python -m supervisor.services remove --> FAIL
> python -m supervisor.services remove
Traceback (most recent call last):
File "C:\Python37\Lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Python37\Lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "c:\ta\virtualenv\my_venv_1\lib\site-packages\supervisor_win-4.4.0-py3.7.egg\supervisor\services.py", line 13, in <module>
import servicemanager
ModuleNotFoundError: No module named 'servicemanager'
(possible) problem, dependencies are installed as eggs = do not work
> python -m supervisor.services remove
Removing service Supervisor Pyv3.7-32
Error removing service: The specified service does not exist as an installed service. (1060)
... and the difference is how the packages are installed i.e. not eggs
For comparison:
If I install that "my_package" from a wheel to anothter virtualenv then it works out of the box.
i.e. pip list shows my package now like this
> pip list
Package Version
------------------ ----------
my_package 0.0.0.dev1
again the command works:
> python -m supervisor.services remove
Removing service Supervisor Pyv3.7-32
Error removing service: The specified service does not exist as an installed service. (1060)
create a wheel for "my_package" (i.e. python setup.py bdist_wheel)
install that that wheel with pip (i.e. pip install path\to\my_package.whl)
i.e. after this pip list shows my package
> pip list
Package Version
------------------ ----------
my_package 0.0.0.dev1
run python -m supervisor.services remove --> FAIL
> python -m supervisor.services remove
===== command execution failed ====
Traceback (most recent call last):
File "C:\Python37\lib\site-packages\supervisor\services.py", line 303, in <module>
main()
File "C:\Python37\lib\site-packages\supervisor\services.py", line 298, in main
win32serviceutil.HandleCommandLine(SupervisorService, argv=srv_argv)
File "C:\Python37\lib\site-packages\win32\lib\win32serviceutil.py", line 551, in HandleCommandLine
import getopt
ModuleNotFoundError: No module named 'getopt'
This time the egg-distributions cannot be the problem:
I also have this error and I tried to solve it with following code but failed: pip install Locales
I reinstalled supervisord from github and then I was able to install it as a Windows Service python -m pip install git+https://github.com/alexsilva/supervisor@windows -U python -m supervisor.services install -c C:\python\supervisord\supervisord.conf
Still, Windows Service was crashing because I didn't replace %(ENV_TMP) from config file.
After it was fixed Service was allowed to start and web interface opens
Environment
When running
python -m supervisor.services
(remove
orinstall
)ModuleNotFoundError
errors are raised, e.g.NOTE:
To me it looks like that the problems are caused by the pywin32 package (i.e. pywin32 bugs or how pywin32 is used in supervisor-win).
--> this issue might end up as "WONTFOX" but I'll document my findings here anyway for the others who might have the same problem.
There are several scenarios where this happens
Scenario-1: virtualenv & supervisor-win as depency to "develop" install
Steps to reprocude:
0) create and activate a python virtualenv
python setup.py develop
)i.e. after this
pip list
shows my packagepython -m supervisor.services remove
--> FAIL(possible) problem, dependencies are installed as eggs = do not work
Workaround:
Install supervisor-win and pywin32 manually i.e. run
Now the command works:
... and the difference is how the packages are installed i.e. not eggs
For comparison:
If I install that "my_package" from a wheel to anothter virtualenv then it works out of the box.
i.e.
pip list
shows my package now like thisagain the command works:
... and the packages here are also not eggs
Scenario-2: no virtualenv & supervisor-win as depency to wheel install
Steps to reprocude:
0) in global python env (no virtualenv)
python setup.py bdist_wheel
)pip install path\to\my_package.whl
)i.e. after this
pip list
shows my packagepython -m supervisor.services remove
--> FAILThis time the egg-distributions cannot be the problem:
Workaround:
The workaround from #12 helps here also: add
PYTHONBINPATH
toPYTHONPATH
env variable i.e.However this is quite ugly workaround, that might cause issues elsewhere because that changes the default search order i.e.
without
PYTHONPATH
with
PYTHONPATH=%PYTHONBINPATH%
The text was updated successfully, but these errors were encountered: