-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_venv.sh
More file actions
executable file
·51 lines (40 loc) · 1.6 KB
/
setup_venv.sh
File metadata and controls
executable file
·51 lines (40 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# Setup script for EngineDesign on macOS (Apple Silicon)
set -e
echo "Setting up EngineDesign virtual environment..."
# Activate virtual environment if it exists
if [ -d ".venv" ]; then
source .venv/bin/activate
echo "Virtual environment activated"
else
echo "Creating virtual environment..."
python3 -m venv .venv
source .venv/bin/activate
fi
# Upgrade pip
echo "Upgrading pip..."
pip install --upgrade pip setuptools wheel
# Install numpy and scipy first to ensure correct architecture
echo "Installing numpy and scipy..."
pip install numpy scipy
# Try to install build dependencies, but continue if it fails
echo "Installing build dependencies (mesonpy, meson, ninja)..."
pip install mesonpy meson ninja || echo "Warning: Could not install some build dependencies, will try alternative method"
# Set architecture flags for Apple Silicon
export ARCHFLAGS="-arch arm64"
# Try installing rocketcea with --no-build-isolation first, fall back to regular install
echo "Installing rocketcea (this may take a few minutes)..."
if pip install --no-build-isolation rocketcea 2>/dev/null; then
echo "✓ Installed rocketcea with --no-build-isolation"
else
echo "Trying regular installation with ARCHFLAGS..."
pip install rocketcea
fi
# Install remaining dependencies
echo "Installing remaining dependencies..."
pip install pandas matplotlib pydantic PyYAML rocketpy streamlit plotly ezdxf cma CoolProp fastapi "uvicorn[standard]" python-multipart
echo ""
echo "✓ Installation complete!"
echo ""
echo "To activate the virtual environment in the future, run:"
echo " source .venv/bin/activate"