This guide provides comprehensive installation instructions for Python Arcade Suite, including prerequisites, setup options, and troubleshooting common issues.
Problem: Streamlit isn’t installed or isn’t in your Python path.Solution:
pip install --upgrade streamlit# If using virtual environment, make sure it's activated:source venv/bin/activate # Linux/macOSvenv\Scripts\activate # Windows
Permission denied when installing packages
Problem: Insufficient permissions to install packages globally.Solution (choose one):
# Option 1: Use virtual environment (recommended)python -m venv venvsource venv/bin/activatepip install -r requirements.txt# Option 2: Install for current user onlypip install --user -r requirements.txt# Option 3: Use sudo (not recommended)sudo pip install -r requirements.txt
Address already in use (Port 8501)
Problem: Another application is using port 8501.Solution:
# Find and kill the process using port 8501# On Linux/macOS:lsof -ti:8501 | xargs kill -9# On Windows:netstat -ano | findstr :8501taskkill /PID <PID> /F# Or run on a different port:streamlit run streamlit_app.py --server.port 8502
Python version too old
Problem: Your Python version is below 3.9.Solution:
# Check your versionpython --version# Install Python 3.9+ using your system's package manager# Ubuntu/Debian:sudo apt install python3.9# macOS (Homebrew):brew install[email protected]# Then create a virtual environment with the correct version:python3.9 -m venv venv
Browser doesn't open automatically
Problem: Streamlit can’t detect or launch your default browser.Solution:
# Manually open your browser and navigate to:http://localhost:8501# Or specify browser:streamlit run streamlit_app.py --browser.serverAddress localhost
Game state resets unexpectedly
Problem: Session state is lost when switching between games.Solution: This is expected behavior. Each game manages its own session state using unique keys:
State persists within each game but is independent across games.
FileNotFoundError for Hangman words
Problem: Can’t find Hangman/DATA/DATA.txt.Solution: The code has a fallback, but you can verify the file exists:
ls -la Hangman/DATA/DATA.txt# If missing, the game will use default words:# ["PYTHON", "STREAMLIT", "DEVELOPER", "AHORCADO"]
The fallback is implemented in Hangman/streamlit_game.py:11:
def read_words_from_file(filepath): try: with open(filepath, 'r', encoding='utf-8') as file: words = [line.strip().upper() for line in file if line.strip()] return words except FileNotFoundError: return ["PYTHON", "STREAMLIT", "DEVELOPER", "AHORCADO"]
cd Python_Arcade# Stash any local changes (if you modified the code)git stash# Pull the latest changesgit pull origin main# Reapply your changes (if any)git stash pop# Update dependenciespip install -r requirements.txt --upgrade
# Clone with SSH for push accessgit clone[email protected]:YorberR/Python_Arcade.gitcd Python_Arcade# Create development environmentpython -m venv venv-devsource venv-dev/bin/activate# Install in editable mode with dev dependenciespip install -e .pip install streamlit pytest black flake8# Run in development mode with auto-reloadstreamlit run streamlit_app.py --server.runOnSave true