Switch from venv to conda for environment management
Build Server .exe / build (push) Failing after 2m30s
Build Server .exe / build (push) Failing after 2m30s
- start.bat and start.sh now create conda env (paperdash, Python 3.11) - README updated with conda setup instructions - Fixes pyhwinfo installation issues on Python 3.12+
This commit is contained in:
@@ -120,12 +120,12 @@ e-ink-dash/
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd server
|
cd server
|
||||||
python start.bat # Windows
|
bash start.bat # Windows
|
||||||
# or
|
# or
|
||||||
bash start.sh # Linux/macOS
|
bash start.sh # Linux/macOS
|
||||||
```
|
```
|
||||||
|
|
||||||
The scripts create a venv, install dependencies, and start the server. On first run, `config.yaml` is auto-generated with:
|
The scripts create a conda env (`paperdash` with Python 3.11), install dependencies, and start the server. On first run, `config.yaml` is auto-generated with:
|
||||||
|
|
||||||
- A random 6-digit PIN (logged to console)
|
- A random 6-digit PIN (logged to console)
|
||||||
- A random API token (logged to console)
|
- A random API token (logged to console)
|
||||||
@@ -136,8 +136,8 @@ The scripts create a venv, install dependencies, and start the server. On first
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd server
|
cd server
|
||||||
python -m venv venv
|
conda create -y -n paperdash python=3.11
|
||||||
venv\Scripts\activate # Windows
|
conda activate paperdash
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
python -m uvicorn main:app --host 0.0.0.0 --port 8921
|
python -m uvicorn main:app --host 0.0.0.0 --port 8921
|
||||||
```
|
```
|
||||||
|
|||||||
+8
-8
@@ -1,20 +1,20 @@
|
|||||||
@echo off
|
@echo off
|
||||||
REM PaperDash Server Startup Script
|
REM PaperDash Server Startup Script
|
||||||
REM Creates venv if needed, installs dependencies, and starts the server
|
REM Creates conda env if needed, installs dependencies, and starts the server
|
||||||
|
|
||||||
setlocal
|
setlocal
|
||||||
|
|
||||||
cd /d "%~dp0"
|
cd /d "%~dp0"
|
||||||
|
|
||||||
REM Create venv if it doesn't exist
|
REM Check if conda env exists
|
||||||
if not exist "venv" (
|
if not exist "conda_env" (
|
||||||
echo Creating virtual environment...
|
echo Creating conda environment...
|
||||||
python -m venv venv
|
conda create -y -n paperdash python=3.11
|
||||||
|
call conda activate paperdash
|
||||||
|
) else (
|
||||||
|
call conda activate paperdash
|
||||||
)
|
)
|
||||||
|
|
||||||
REM Activate venv
|
|
||||||
call venv\Scripts\activate.bat
|
|
||||||
|
|
||||||
REM Install dependencies
|
REM Install dependencies
|
||||||
echo Installing dependencies...
|
echo Installing dependencies...
|
||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
|
|||||||
+7
-7
@@ -1,20 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# PaperDash Server Startup Script
|
# PaperDash Server Startup Script
|
||||||
# Creates venv if needed, installs dependencies, and starts the server
|
# Creates conda env if needed, installs dependencies, and starts the server
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
cd "$SCRIPT_DIR"
|
cd "$SCRIPT_DIR"
|
||||||
|
|
||||||
# Create venv if it doesn't exist
|
# Check if conda env exists
|
||||||
if [ ! -d "venv" ]; then
|
if ! conda env list | grep -q "paperdash"; then
|
||||||
echo "Creating virtual environment..."
|
echo "Creating conda environment..."
|
||||||
python3 -m venv venv
|
conda create -y -n paperdash python=3.11
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Activate venv
|
# Activate conda env
|
||||||
source venv/bin/activate
|
conda activate paperdash
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
echo "Installing dependencies..."
|
echo "Installing dependencies..."
|
||||||
|
|||||||
Reference in New Issue
Block a user