Python Environment Setup¶
This section explains how to create an isolated Python environment and install the required dependencies.
Using a virtual environment ensures that project dependencies do not interfere with system-wide Python packages.
1. Verify Python Version¶
TG-FileStream requires:
- Python 3.10 or higher
Check your version:
If Python is not installed:
2. Create Virtual Environment¶
Inside the project directory:
This creates a folder named venv/ containing an isolated Python environment.
3. Activate Virtual Environment¶
After activation, your terminal should show:
This indicates the environment is active.
4. Upgrade pip (Recommended)¶
5. Install Project Dependencies¶
Install all required packages:
Wait for installation to complete.
6. Verify Installation¶
You can verify installed packages:
Ensure required libraries such as:
- aiohttp
- telethon
- aiomysql
- dnspython
- python-dotenv (if used)
are installed successfully.
7. Deactivate Virtual Environment (Optional)¶
To exit the virtual environment:
You must reactivate it before running the application.
Important Notes¶
- Always activate the virtual environment before running the application.
- Do not install dependencies globally.
- Do not delete the
venv/directory after setup.