Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@ rm -rf gui/build/macos

# 3. Thực hiện build
echo "🔨 Bắt đầu biên dịch..."
# Tạo và kích hoạt môi trường ảo nếu chưa tồn tại
if [ ! -d ".venv" ]; then
echo "🛠️ Tạo môi trường ảo..."
python3 -m venv .venv
fi
echo "⚡ Kích hoạt môi trường ảo..."
source .venv/bin/activate

# Cài đặt các thư viện cần thiết
echo "📦 Cài đặt thư viện..."
pip install -r requirements.txt

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For improved robustness and adherence to Python best practices, it's recommended to invoke pip via python -m pip. This ensures that you're using the pip instance associated with the correct Python interpreter from your virtual environment. It's also a good practice to upgrade pip itself to the latest version before installing dependencies, especially in a newly created environment.

Suggested change
pip install -r requirements.txt
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

cd gui

# Tạm thời tắt set -e vì flet build có thể ném traceback SystemExit: 0 nhưng thực tế build vẫn thành công
Expand Down