-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using virtualenv in windows service,cannot find the correct python.exe path #467
Comments
This strikes me as more likely an issue with multiprocessing/forking.py @pfmoore any opinions on the right way to get the path to the python.exe |
Agreed. This is a bug in multiprocessing/forking.py. Note that the docs for sys.exec_prefix don't say that python.exe is always located in that directory (and that's what isn't true for a virtualenv). Actually, as Python doesn't come with a pythonservice.exe (that's in pywin32) this is the standard library trying to support running via a 3rd party package (and getting it wrong when a virtualenv is involved). It's hard to know how best to address this. But it's not our problem (as a data point, a Python 3.3 venv would have the same issue). You could look for sys.prefix/python.exe and sys.prefix/Scripts/python.exe and use whichever exists. That's a bit of a hack, but it's the best I can suggest without knowing more about how pywin32 works. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions. |
PYTHON 2.7
using virtualenv in windows service,cannot find the correct python.exe path,
in multiprocessing/forking.py file there is code(line 217):
if WINSERVICE:
_python_exe = os.path.join(sys.exec_prefix, 'python.exe')
this path not find python.exe ,because in virtualenv the python.exe file is at
os.path.join(sys.exec_prefix, 'Scripts','python.exe')
The text was updated successfully, but these errors were encountered: