Closed bertlea closed 2 years ago
I found a kind of work-around: use a .cmd batch file to set the environment PATH and then call the python program within that batch file. Then run the websocketd with that batch file. It seems to work, but not perfectly as when I exit the program, it will not disconnect, but stays in the Python interactive interpreter mode. I need to send "quit()" to fully quit and disconnect.
Somehow, I cannot use the Python venv scripts to entre the venv. Need manually set the PATH.
Not sure if this case can be closed. If there are better way, it will be nice to share.
I bet there are certain variables from your venv that aren't getting passed to make python work properly under websocketd...
Any experts here to know which addition to --passenv
could help that?
What version of websocketd did you use? I'm pretty sure some of them did not pass enough vars on windows but new ones should have PATH and some others copied.
version 0.4.1 platform Windows amd64
My Python3 program need to run under venv to access some modules only installed to the venv. After I entered the venv, I can run the program: main.py, then under the same venv, I attempted to run the websocketd:
websocketd --port=8080 py main.py
It spit out an error: "ModuleNotFoundError: No module named" and disconnected/terminated.
I wonder if there is some special settings / parameters I need to apply in order to run the Python program under venv. Or Python venv cannot be supported?