File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- # Update the package list and install python3-venv
4
- sudo apt-get update
5
- sudo apt-get install -y python3-venv
6
-
7
3
# Check if python3 is available
8
4
if ! command -v python3 & > /dev/null
9
5
then
10
6
echo " Python3 could not be found"
11
7
exit 1
12
8
fi
13
9
10
+ # Check if python3-venv is available
11
+ if ! python3 -m venv & > /dev/null
12
+ then
13
+ echo " Installing python3-venv"
14
+ apt-get update
15
+ apt-get install -y python3-venv
16
+ fi
17
+
18
+ # Create and activate a virtual environment
19
+ python3 -m venv venv
20
+ source venv/bin/activate
21
+
14
22
# Ensure pip is available
15
23
if ! command -v pip & > /dev/null
16
24
then
25
+ echo " Installing pip"
17
26
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
18
27
python3 get-pip.py
19
28
rm get-pip.py
20
29
fi
21
30
22
- # Create and activate a virtual environment
23
- python3 -m venv venv
24
- source venv/bin/activate
25
-
26
31
# Install dependencies
27
32
pip install --upgrade pip
28
33
pip install -r requirements.txt
You can’t perform that action at this time.
0 commit comments