Add automated setup and run scripts for Virtual Environment support
- setup.sh / setup.bat: Create venv, install dependencies - run.sh / run.bat: Activate venv and start main.py - .gitignore: Exclude venv, cache, IDE files - README.md: Updated installation guide with PEP 668 solution
This commit is contained in:
parent
27489a1d94
commit
486f166462
|
|
@ -0,0 +1,32 @@
|
|||
# Virtual Environment
|
||||
venv/
|
||||
env/
|
||||
.venv/
|
||||
|
||||
# Python Cache
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.pyo
|
||||
|
||||
# IDE
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Output files
|
||||
output/*.cor
|
||||
output/*.csv
|
||||
output/*.txt
|
||||
output/*.dxf
|
||||
|
||||
# Temporary files
|
||||
*.tmp
|
||||
*.temp
|
||||
*.bak
|
||||
119
README.md
119
README.md
|
|
@ -52,36 +52,119 @@ Ein vollständiges Python-Programm mit grafischer Benutzeroberfläche (GUI) für
|
|||
- Export der transformierten JXL-Datei
|
||||
- Validierung der Eingaben mit Warnungen bei problematischen Werten
|
||||
|
||||
## Installation
|
||||
## Installation und Start
|
||||
|
||||
### Voraussetzungen
|
||||
- Python 3.8 oder höher
|
||||
- PyQt5
|
||||
- NumPy
|
||||
- SciPy
|
||||
- lxml
|
||||
- PyQt5, NumPy, SciPy, lxml
|
||||
|
||||
### Installation der Abhängigkeiten
|
||||
### Wichtiger Hinweis: Externally-Managed-Environment (PEP 668)
|
||||
|
||||
**Option 1: Mit requirements.txt (empfohlen)**
|
||||
```bash
|
||||
cd /home/ubuntu/trimble_geodesy
|
||||
pip install -r requirements.txt
|
||||
Moderne Linux-Distributionen (Ubuntu 23.04+, Debian 12+, Fedora 38+) verwenden ein "externally-managed-environment". Das bedeutet, dass `pip install` ohne Virtual Environment folgenden Fehler erzeugt:
|
||||
|
||||
```
|
||||
error: externally-managed-environment
|
||||
× This environment is externally managed
|
||||
```
|
||||
|
||||
**Option 2: Manuelle Installation**
|
||||
**Lösung:** Verwenden Sie ein Virtual Environment (empfohlen) oder die automatischen Setup-Scripts.
|
||||
|
||||
---
|
||||
|
||||
### Methode 1: Automatische Installation (empfohlen)
|
||||
|
||||
#### Linux / macOS
|
||||
|
||||
```bash
|
||||
pip install PyQt5 numpy scipy lxml
|
||||
cd /home/ubuntu/trimble_geodesy
|
||||
|
||||
# 1. Setup ausführen (einmalig)
|
||||
./setup.sh
|
||||
|
||||
# 2. Programm starten
|
||||
./run.sh
|
||||
```
|
||||
|
||||
Falls `./setup.sh` nicht ausführbar ist:
|
||||
```bash
|
||||
chmod +x setup.sh run.sh
|
||||
./setup.sh
|
||||
```
|
||||
|
||||
#### Windows
|
||||
|
||||
```cmd
|
||||
cd C:\Pfad\zum\trimble_geodesy
|
||||
|
||||
REM 1. Setup ausführen (einmalig)
|
||||
setup.bat
|
||||
|
||||
REM 2. Programm starten
|
||||
run.bat
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Methode 2: Manuelle Installation mit Virtual Environment
|
||||
|
||||
#### Linux / macOS
|
||||
|
||||
```bash
|
||||
cd /home/ubuntu/trimble_geodesy
|
||||
|
||||
# Virtual Environment erstellen
|
||||
python3 -m venv venv
|
||||
|
||||
# Virtual Environment aktivieren
|
||||
source venv/bin/activate
|
||||
|
||||
# Abhängigkeiten installieren
|
||||
pip install -r requirements.txt
|
||||
|
||||
# Programm starten
|
||||
python3 main.py
|
||||
```
|
||||
|
||||
#### Windows
|
||||
|
||||
```cmd
|
||||
cd C:\Pfad\zum\trimble_geodesy
|
||||
|
||||
REM Virtual Environment erstellen
|
||||
python -m venv venv
|
||||
|
||||
REM Virtual Environment aktivieren
|
||||
venv\Scripts\activate.bat
|
||||
|
||||
REM Abhängigkeiten installieren
|
||||
pip install -r requirements.txt
|
||||
|
||||
REM Programm starten
|
||||
python main.py
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Fehlerbehebung
|
||||
|
||||
**Fehler: `python3-venv` nicht installiert (Linux)**
|
||||
```bash
|
||||
sudo apt install python3-venv # Ubuntu/Debian
|
||||
sudo dnf install python3-venv # Fedora
|
||||
```
|
||||
|
||||
**Fehler: Permission denied bei setup.sh**
|
||||
```bash
|
||||
chmod +x setup.sh run.sh
|
||||
```
|
||||
|
||||
**Fehler: Qt-Plattform nicht gefunden**
|
||||
```bash
|
||||
sudo apt install libxcb-xinerama0 libxcb-cursor0 # Ubuntu/Debian
|
||||
```
|
||||
|
||||
## Verwendung
|
||||
|
||||
### Programm starten
|
||||
```bash
|
||||
cd /home/ubuntu/trimble_geodesy
|
||||
python3 main.py
|
||||
```
|
||||
|
||||
### Workflow
|
||||
1. **JXL-Analyse Tab**: JXL-Datei laden und analysieren
|
||||
2. **COR-Generator Tab**: Koordinaten generieren und exportieren
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
@echo off
|
||||
REM
|
||||
REM Trimble Geodesy Tool - Run Script (Windows)
|
||||
REM Aktiviert das Virtual Environment und startet das Programm
|
||||
REM
|
||||
|
||||
REM Wechsle ins Script-Verzeichnis
|
||||
cd /d "%~dp0"
|
||||
|
||||
REM Pruefe ob Virtual Environment existiert
|
||||
if not exist venv (
|
||||
echo X Fehler: Virtual Environment nicht gefunden.
|
||||
echo.
|
||||
echo Bitte zuerst setup.bat ausfuehren
|
||||
echo.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM Aktiviere Virtual Environment
|
||||
call venv\Scripts\activate.bat
|
||||
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo X Fehler beim Aktivieren des Virtual Environments
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM Starte das Programm
|
||||
echo Starte Trimble Geodesy Tool...
|
||||
python main.py
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Trimble Geodesy Tool - Run Script (Linux/macOS)
|
||||
# Aktiviert das Virtual Environment und startet das Programm
|
||||
#
|
||||
|
||||
# Wechsle ins Script-Verzeichnis
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
# Prüfe ob Virtual Environment existiert
|
||||
if [ ! -d "venv" ]; then
|
||||
echo "❌ Fehler: Virtual Environment nicht gefunden."
|
||||
echo ""
|
||||
echo " Bitte zuerst setup.sh ausführen:"
|
||||
echo " ./setup.sh"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Aktiviere Virtual Environment
|
||||
source venv/bin/activate
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "❌ Fehler beim Aktivieren des Virtual Environments"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Starte das Programm
|
||||
echo "Starte Trimble Geodesy Tool..."
|
||||
python3 main.py
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
@echo off
|
||||
REM
|
||||
REM Trimble Geodesy Tool - Setup Script (Windows)
|
||||
REM Erstellt ein Virtual Environment und installiert alle Abhängigkeiten
|
||||
REM
|
||||
|
||||
echo ========================================
|
||||
echo Trimble Geodesy Tool - Setup
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
REM Wechsle ins Script-Verzeichnis
|
||||
cd /d "%~dp0"
|
||||
|
||||
REM Pruefe ob Python installiert ist
|
||||
python --version >nul 2>&1
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo X Fehler: Python ist nicht installiert.
|
||||
echo Bitte installieren Sie Python von https://python.org
|
||||
echo Wichtig: Bei der Installation "Add Python to PATH" aktivieren!
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [OK] Python gefunden
|
||||
|
||||
REM Erstelle Virtual Environment
|
||||
echo.
|
||||
echo -^> Erstelle Virtual Environment...
|
||||
|
||||
if exist venv (
|
||||
echo Virtual Environment existiert bereits.
|
||||
set /p REPLY=" Neu erstellen? (j/n): "
|
||||
if /i "%REPLY%"=="j" (
|
||||
rmdir /s /q venv
|
||||
python -m venv venv
|
||||
echo [OK] Virtual Environment neu erstellt
|
||||
)
|
||||
) else (
|
||||
python -m venv venv
|
||||
echo [OK] Virtual Environment erstellt
|
||||
)
|
||||
|
||||
REM Aktiviere Virtual Environment
|
||||
echo.
|
||||
echo -^> Aktiviere Virtual Environment...
|
||||
call venv\Scripts\activate.bat
|
||||
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo X Fehler beim Aktivieren des Virtual Environments
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [OK] Virtual Environment aktiviert
|
||||
|
||||
REM Upgrade pip
|
||||
echo.
|
||||
echo -^> Aktualisiere pip...
|
||||
pip install --upgrade pip --quiet
|
||||
echo [OK] pip aktualisiert
|
||||
|
||||
REM Installiere Abhaengigkeiten
|
||||
echo.
|
||||
echo -^> Installiere Abhaengigkeiten aus requirements.txt...
|
||||
pip install -r requirements.txt
|
||||
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo X Fehler beim Installieren der Abhaengigkeiten
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo.
|
||||
echo ========================================
|
||||
echo [OK] Setup erfolgreich abgeschlossen!
|
||||
echo ========================================
|
||||
echo.
|
||||
echo Zum Starten des Programms:
|
||||
echo run.bat
|
||||
echo.
|
||||
echo Oder manuell:
|
||||
echo venv\Scripts\activate.bat
|
||||
echo python main.py
|
||||
echo.
|
||||
pause
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Trimble Geodesy Tool - Setup Script (Linux/macOS)
|
||||
# Erstellt ein Virtual Environment und installiert alle Abhängigkeiten
|
||||
#
|
||||
|
||||
echo "========================================"
|
||||
echo " Trimble Geodesy Tool - Setup"
|
||||
echo "========================================"
|
||||
echo ""
|
||||
|
||||
# Wechsle ins Script-Verzeichnis
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
# Prüfe ob Python3 installiert ist
|
||||
if ! command -v python3 &> /dev/null; then
|
||||
echo "❌ Fehler: Python3 ist nicht installiert."
|
||||
echo " Bitte installieren Sie Python3:"
|
||||
echo " Ubuntu/Debian: sudo apt install python3"
|
||||
echo " Fedora: sudo dnf install python3"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✓ Python3 gefunden: $(python3 --version)"
|
||||
|
||||
# Prüfe ob python3-venv installiert ist
|
||||
if ! python3 -c "import venv" &> /dev/null; then
|
||||
echo ""
|
||||
echo "❌ Fehler: python3-venv ist nicht installiert."
|
||||
echo ""
|
||||
echo " Bitte installieren Sie python3-venv:"
|
||||
echo " Ubuntu/Debian: sudo apt install python3-venv"
|
||||
echo " Fedora: sudo dnf install python3-venv"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✓ python3-venv ist verfügbar"
|
||||
|
||||
# Erstelle Virtual Environment
|
||||
echo ""
|
||||
echo "→ Erstelle Virtual Environment..."
|
||||
|
||||
if [ -d "venv" ]; then
|
||||
echo " Virtual Environment existiert bereits."
|
||||
read -p " Neu erstellen? (j/n): " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Jj]$ ]]; then
|
||||
rm -rf venv
|
||||
python3 -m venv venv
|
||||
echo " ✓ Virtual Environment neu erstellt"
|
||||
fi
|
||||
else
|
||||
python3 -m venv venv
|
||||
echo " ✓ Virtual Environment erstellt"
|
||||
fi
|
||||
|
||||
# Aktiviere Virtual Environment
|
||||
echo ""
|
||||
echo "→ Aktiviere Virtual Environment..."
|
||||
source venv/bin/activate
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "❌ Fehler beim Aktivieren des Virtual Environments"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo " ✓ Virtual Environment aktiviert"
|
||||
|
||||
# Upgrade pip
|
||||
echo ""
|
||||
echo "→ Aktualisiere pip..."
|
||||
pip install --upgrade pip --quiet
|
||||
echo " ✓ pip aktualisiert"
|
||||
|
||||
# Installiere Abhängigkeiten
|
||||
echo ""
|
||||
echo "→ Installiere Abhängigkeiten aus requirements.txt..."
|
||||
pip install -r requirements.txt
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo ""
|
||||
echo "❌ Fehler beim Installieren der Abhängigkeiten"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "========================================"
|
||||
echo " ✓ Setup erfolgreich abgeschlossen!"
|
||||
echo "========================================"
|
||||
echo ""
|
||||
echo "Zum Starten des Programms:"
|
||||
echo " ./run.sh"
|
||||
echo ""
|
||||
echo "Oder manuell:"
|
||||
echo " source venv/bin/activate"
|
||||
echo " python3 main.py"
|
||||
echo ""
|
||||
Loading…
Reference in New Issue