mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2025-01-04 14:05:04 +08:00
Use sys.executable to determine --pycmd (#715)
* Use sys.executable to determine --pycmd In some systems, `python` may not correctly refer to the virtual environment's `python` used for webui, or it even refers to Python 2. Also in Windows, when the webui is run directly through `venv\Scripts\python` without activating the virtual environment, the system python will be picked instead of the one inside virtual environment. * Remove reduntant "or".
This commit is contained in:
parent
211e13b80a
commit
a2848f40bb
@ -1,4 +1,5 @@
|
|||||||
import argparse
|
import argparse
|
||||||
|
import sys
|
||||||
import torch
|
import torch
|
||||||
from multiprocessing import cpu_count
|
from multiprocessing import cpu_count
|
||||||
|
|
||||||
@ -33,10 +34,11 @@ class Config:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def arg_parse() -> tuple:
|
def arg_parse() -> tuple:
|
||||||
|
exe = sys.executable or "python"
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("--port", type=int, default=7865, help="Listen port")
|
parser.add_argument("--port", type=int, default=7865, help="Listen port")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--pycmd", type=str, default="python", help="Python command"
|
"--pycmd", type=str, default=exe, help="Python command"
|
||||||
)
|
)
|
||||||
parser.add_argument("--colab", action="store_true", help="Launch in colab")
|
parser.add_argument("--colab", action="store_true", help="Launch in colab")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
|
Loading…
Reference in New Issue
Block a user