mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2024-12-29 19:15:04 +08:00
fix run.sh on mac (#1755)
This commit is contained in:
parent
5dbdbab2c1
commit
5c55d5378b
10
run.sh
10
run.sh
@ -17,7 +17,7 @@ else
|
||||
requirements_file="requirements.txt"
|
||||
|
||||
# Check if Python 3.8 is installed
|
||||
if ! command -v python3 >/dev/null 2>&1; then
|
||||
if ! command -v python3.8 >/dev/null 2>&1 || pyenv versions --bare | grep -q "3.8"; then
|
||||
echo "Python 3 not found. Attempting to install 3.8..."
|
||||
if [ "$(uname)" = "Darwin" ] && command -v brew >/dev/null 2>&1; then
|
||||
brew install python@3.8
|
||||
@ -30,18 +30,18 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
python3 -m venv .venv
|
||||
python3.8 -m venv .venv
|
||||
. .venv/bin/activate
|
||||
|
||||
# Check if required packages are installed and install them if not
|
||||
if [ -f "${requirements_file}" ]; then
|
||||
installed_packages=$(python3 -m pip freeze)
|
||||
installed_packages=$(python3.8 -m pip freeze)
|
||||
while IFS= read -r package; do
|
||||
expr "${package}" : "^#.*" > /dev/null && continue
|
||||
package_name=$(echo "${package}" | sed 's/[<>=!].*//')
|
||||
if ! echo "${installed_packages}" | grep -q "${package_name}"; then
|
||||
echo "${package_name} not found. Attempting to install..."
|
||||
python3 -m pip install --upgrade "${package}"
|
||||
python3.8 -m pip install --upgrade "${package}"
|
||||
fi
|
||||
done < "${requirements_file}"
|
||||
else
|
||||
@ -58,4 +58,4 @@ if [ $? -ne 0 ]; then
|
||||
fi
|
||||
|
||||
# Run the main script
|
||||
python3 infer-web.py --pycmd python3
|
||||
python3.8 infer-web.py --pycmd python3.8
|
||||
|
Loading…
Reference in New Issue
Block a user