Installation Guide For Developers - panuozzo77/StreamingCommunity GitHub Wiki
This guide details how to set up the StreamingCommunity
project for development purposes. While the primary focus is on using PyCharm IDE, the core steps involving Git and Python's virtual environments are applicable to most development setups.
Before you begin, ensure you have the following installed on your system:
- Git: Required for cloning the repository.
-
Verify Installation: Open your terminal or command prompt and run
git --version
. -
Installation: Download from git-scm.com.
- Python: The project requires Python 3.7 or newer (Python 3.8+ recommended).
-
Verify Installation: Run
python --version
orpython3 --version
. -
Installation: Download from python.org. Make sure to check the option "Add Python to PATH" during installation on Windows.
- pip: Python's package installer, usually included with Python.
-
Verify Installation: Run
pip --version
orpython -m pip --version
.
First, you need to clone the project repository from GitHub.
-
Navigate: Open your terminal or command prompt and navigate to the directory where you want to store the project. Let's call this
development_workspace
.
# Example using Linux/macOS/Git Bash:
mkdir ~/development_workspace
cd ~/development_workspace
# Example using Windows Command Prompt:
mkdir %USERPROFILE%\development_workspace
cd %USERPROFILE%\development_workspace
- Clone: Clone the repository using either HTTPS (recommended for simplicity) or SSH (if you have SSH keys configured with GitHub).
- Using HTTPS:
git clone https://github.com/Arrowar/StreamingCommunity.git
- Using SSH:
git clone [email protected]:Arrowar/StreamingCommunity.git
- Enter Project Directory: Move into the newly cloned project folder.
cd StreamingCommunity
All subsequent commands should be run from this StreamingCommunity
root directory unless otherwise specified.
Using a virtual environment is crucial for isolating project dependencies and avoiding conflicts with other Python projects or your global Python installation.
Method A: Using Command Line (Recommended for cross-IDE compatibility)
-
Create: In the
StreamingCommunity
root directory, create a virtual environment (commonly namedvenv
).
# Linux/macOS
python3 -m venv venv
# Windows
python -m venv venv
This will create a venv
folder within your project directory. This folder should not be committed to Git (ensure .venv
or venv/
is in your .gitignore
file).
- Activate: Activate the virtual environment. The activation command differs between operating systems.
- Linux/macOS (bash/zsh):
source venv/bin/activate
Your terminal prompt should now be prefixed with (venv)
.
- Windows (Command Prompt):
.\venv\Scripts\activate.bat
Your terminal prompt should now be prefixed with (venv)
.
- Windows (PowerShell):
.\venv\Scripts\Activate.ps1
(Note: You might need to adjust your PowerShell execution policy: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
)
Your terminal prompt should now be prefixed with (venv)
.
Important: You need to activate the virtual environment every time you open a new terminal session to work on this project.
Method B: Using PyCharm
PyCharm typically helps manage virtual environments.
-
Open Project: Open PyCharm and select
File > Open...
, then navigate to and select the clonedStreamingCommunity
folder. -
Configure Interpreter:
-
PyCharm might automatically detect the project and suggest creating a virtual environment or configuring an interpreter.
-
If not, go to
File > Settings
(orPyCharm > Preferences
on macOS). -
Navigate to
Project: StreamingCommunity > Python Interpreter
. -
Click the gear icon ⚙️ and select
Add...
. -
Choose
Virtualenv Environment
from the left pane. -
Select
New environment
(usually the default). Ensure theLocation
points to avenv
folder inside your project directory (e.g.,...\StreamingCommunity\venv
). -
Ensure the
Base interpreter
points to your installed Python 3.7+ executable. -
Click
OK
. PyCharm will create the virtual environment. -
The PyCharm Terminal (
View > Tool Windows > Terminal
) should automatically use the activated virtual environment.
Once your virtual environment is created and activated, install the required packages.
-
Install: Run the following command in your terminal (ensure
(venv)
is visible in your prompt if using the command line method):
pip install -r requirements.txt
This command reads the requirements.txt
file and installs all the listed Python packages into your isolated virtual environment.
-
PyCharm Integration: If you configured the interpreter correctly in PyCharm (Step 2B), PyCharm should detect the
requirements.txt
file and might offer to install the dependencies for you, or highlight missing imports. Using thepip install -r requirements.txt
command in the PyCharm Terminal is the most reliable method.
For easier execution during development, you can create a simple script in the project's root directory (StreamingCommunity/
) that directly calls the main function using the virtual environment's Python interpreter.
-
Create the File: In the main
StreamingCommunity
directory (the same level as yourvenv
folder and theStreamingCommunity
package folder), create a new file namedrun
(orrun.py
if you prefer). -
Add Content: Paste the following code into the
run
file:
# (replace with your actual path): #!/path/to/your/project/StreamingCommunity/venv/bin/python
"""
Development run script for StreamingCommunity.
Ensures the application is run using the project's virtual environment
and executes the main entry point.
"""
from StreamingCommunity.main import main
main() # Add arguments here if needed, e.g., main(sys.argv[1:])