install: improve sh scripts
This commit is contained in:
@@ -3,10 +3,22 @@
|
|||||||
echo "Starting installation for Linux..."
|
echo "Starting installation for Linux..."
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
if ! command -v python3.10 &> /dev/null; then
|
||||||
|
echo "Error: Python 3.10 is not installed. Please install Python 3.10 and try again."
|
||||||
|
echo "You can install it using: sudo apt-get install python3.10 python3.10-dev python3.10-venv"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if pip3.10 is available
|
||||||
|
if ! python3.10 -m pip --version &> /dev/null; then
|
||||||
|
echo "Error: pip for Python 3.10 is not installed. Installing python3.10-pip..."
|
||||||
|
sudo apt-get install -y python3.10-pip || { echo "Failed to install python3.10-pip"; exit 1; }
|
||||||
|
fi
|
||||||
|
|
||||||
# Update package list
|
# Update package list
|
||||||
sudo apt-get update || { echo "Failed to update package list"; exit 1; }
|
sudo apt-get update || { echo "Failed to update package list"; exit 1; }
|
||||||
# make sure essential tool are installed
|
# make sure essential tool are installed
|
||||||
# Install essential tools
|
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
python3-dev \
|
python3-dev \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
@@ -21,15 +33,15 @@ sudo apt-get install -y \
|
|||||||
libnss3 \
|
libnss3 \
|
||||||
libxss1 || { echo "Failed to install packages"; exit 1; }
|
libxss1 || { echo "Failed to install packages"; exit 1; }
|
||||||
|
|
||||||
# upgrade pip
|
# Upgrade pip for Python 3.10
|
||||||
pip install --upgrade pip
|
python3.10 -m pip install --upgrade pip || { echo "Failed to upgrade pip"; exit 1; }
|
||||||
# install wheel
|
# Install and upgrade setuptools and wheel
|
||||||
pip install --upgrade pip setuptools wheel
|
python3.10 -m pip install --upgrade setuptools wheel || { echo "Failed to install setuptools and wheel"; exit 1; }
|
||||||
|
# Install Selenium for chromedriver
|
||||||
|
python3.10 -m pip install selenium || { echo "Failed to install selenium"; exit 1; }
|
||||||
|
# Install Python dependencies from requirements.txt
|
||||||
|
python3.10 -m pip install -r requirements.txt --no-cache-dir || { echo "Failed to install requirements.txt"; exit 1; }
|
||||||
# install docker compose
|
# install docker compose
|
||||||
sudo apt install -y docker-compose
|
sudo apt install -y docker-compose
|
||||||
# Install Selenium for chromedriver
|
|
||||||
pip3 install selenium
|
|
||||||
# Install Python dependencies from requirements.txt
|
|
||||||
pip3 install -r requirements.txt --no-cache-dir
|
|
||||||
|
|
||||||
echo "Installation complete for Linux!"
|
echo "Installation complete for Linux!"
|
||||||
@@ -4,6 +4,18 @@ echo "Starting installation for macOS..."
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
if ! command -v python3.10 &> /dev/null; then
|
||||||
|
echo "Error: Python 3.10 is not installed. Please install Python 3.10 and try again."
|
||||||
|
echo "You can install it using: sudo apt-get install python3.10 python3.10-dev python3.10-venv"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if pip3.10 is available
|
||||||
|
if ! python3.10 -m pip --version &> /dev/null; then
|
||||||
|
echo "Error: pip for Python 3.10 is not installed. Installing python3.10-pip..."
|
||||||
|
sudo apt-get install -y python3.10-pip || { echo "Failed to install python3.10-pip"; exit 1; }
|
||||||
|
fi
|
||||||
|
|
||||||
# Check if homebrew is installed
|
# Check if homebrew is installed
|
||||||
if ! command -v brew &> /dev/null; then
|
if ! command -v brew &> /dev/null; then
|
||||||
echo "Homebrew not found. Installing Homebrew..."
|
echo "Homebrew not found. Installing Homebrew..."
|
||||||
@@ -18,13 +30,14 @@ brew install wget
|
|||||||
brew install --cask chromedriver
|
brew install --cask chromedriver
|
||||||
# Install portaudio for pyAudio using Homebrew
|
# Install portaudio for pyAudio using Homebrew
|
||||||
brew install portaudio
|
brew install portaudio
|
||||||
# update pip
|
|
||||||
python3 -m pip install --upgrade pip
|
# Upgrade pip for Python 3.10
|
||||||
# upgrade setuptools and wheel
|
python3.10 -m pip install --upgrade pip || { echo "Failed to upgrade pip"; exit 1; }
|
||||||
pip3 install --upgrade setuptools wheel
|
# Install and upgrade setuptools and wheel
|
||||||
# Install Selenium
|
python3.10 -m pip install --upgrade setuptools wheel || { echo "Failed to install setuptools and wheel"; exit 1; }
|
||||||
pip3 install selenium
|
# Install Selenium for chromedriver
|
||||||
|
python3.10 -m pip install selenium || { echo "Failed to install selenium"; exit 1; }
|
||||||
# Install Python dependencies from requirements.txt
|
# Install Python dependencies from requirements.txt
|
||||||
pip3 install -r requirements.txt --no-cache-dir
|
python3.10 -m pip install -r requirements.txt --no-cache-dir || { echo "Failed to install requirements.txt"; exit 1; }
|
||||||
|
|
||||||
echo "Installation complete for macOS!"
|
echo "Installation complete for macOS!"
|
||||||
Reference in New Issue
Block a user