@@ -13,13 +13,13 @@ log_message() {
1313
1414# Function to find a suitable Python version
1515find_python () {
16- for py in python3.10 python3 python; do
16+ for py in python3.11 python3 python; do
1717 if command -v " $py " > /dev/null 2>&1 ; then
1818 echo " $py "
1919 return
2020 fi
2121 done
22- log_message " No compatible Python installation found. Please install Python 3.10 ."
22+ log_message " No compatible Python installation found. Please install Python 3.11 ."
2323 exit 1
2424}
2525
@@ -96,7 +96,8 @@ create_venv() {
9696 log_message " Creating virtual environment..."
9797 py=$( find_python)
9898
99- " $py " -m venv .venv
99+ curl -LsSf https://astral.sh/uv/install.sh | sh
100+ uv venv .venv --python 3.11
100101
101102 log_message " Activating virtual environment..."
102103 source .venv/bin/activate
@@ -115,7 +116,7 @@ create_venv() {
115116
116117 log_message " Installing dependencies..."
117118 if [ -f " requirements.txt" ]; then
118- python -m pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu128
119+ python -m pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu128 --index-strategy unsafe-best-match
119120 else
120121 log_message " requirements.txt not found. Please ensure it exists."
121122 exit 1
@@ -158,27 +159,27 @@ if [ "$(uname)" = "Darwin" ]; then
158159 # Add more detailed Python version check
159160 log_message " Checking Python versions..."
160161 log_message " python3 path: $( which python3) "
161- log_message " python3.10 path: $( which python3.10 2> /dev/null || echo ' not found' ) "
162+ log_message " python3.11 path: $( which python3.11 2> /dev/null || echo ' not found' ) "
162163
163- if command -v python3.10 > /dev/null 2>&1 ; then
164- python_version=$( python3.10 --version | awk ' {print $2}' | cut -d' .' -f1,2)
164+ if command -v python3.11 > /dev/null 2>&1 ; then
165+ python_version=$( python3.11 --version | awk ' {print $2}' | cut -d' .' -f1,2)
165166 else
166167 python_version=$( python3 --version | awk ' {print $2}' | cut -d' .' -f1,2)
167168 fi
168169
169170 log_message " Detected Python version: $python_version "
170171
171- if [ " $python_version " = " 3.10 " ]; then
172- log_message " Found compatible Python 3.10 "
172+ if [ " $python_version " = " 3.11 " ]; then
173+ log_message " Found compatible Python 3.11 "
173174 else
174- log_message " Python version $python_version is not 3.10 . Installing Python 3.10 using Homebrew..."
175- brew install python@3.10
176- export PATH=" $( brew --prefix) /opt/python@3.10 /bin:$PATH "
175+ log_message " Python version $python_version is not 3.11 . Installing Python 3.11 using Homebrew..."
176+ brew install python@3.11
177+ export PATH=" $( brew --prefix) /opt/python@3.11 /bin:$PATH "
177178 # Verify the installed version
178179 log_message " Verifying installed Python version..."
179- python_version=$( python3.10 --version | awk ' {print $2}' | cut -d' .' -f1,2)
180- if [ " $python_version " != " 3.10 " ]; then
181- log_message " Failed to install Python 3.10 . Current version: $python_version "
180+ python_version=$( python3.11 --version | awk ' {print $2}' | cut -d' .' -f1,2)
181+ if [ " $python_version " != " 3.11 " ]; then
182+ log_message " Failed to install Python 3.11 . Current version: $python_version "
182183 exit 1
183184 fi
184185 fi
0 commit comments