This README provides instructions for setting up a Python environment named networkopt-env
for network optimization tasks, including generating and using a requirements.txt
file.
- Python 3.x installed on your system
pip
(Python package installer)
First, create a virtual environment named networkopt-env
:
python -m venv networkopt-env
Activate the virtual environment using the appropriate command for your operating system:
-
On Unix/Linux/Mac:
source networkopt-env/bin/activate
-
On Windows:
networkopt-env\Scripts\activate
Install the necessary packages for your project. For example:
pip install networkx matplotlib heapq
Generate the requirements.txt
file to list all installed packages:
pip freeze > requirements.txt
If a requirements.txt
file already exists, you can install all listed modules as follows:
Ensure that the virtual environment networkopt-env
is activated (see the activation instructions above).
Install all the required packages listed in the requirements.txt
file:
pip install -r requirements.txt
When you are done working in the virtual environment, you can deactivate it:
deactivate
Once the environment is set up and the required packages are installed, you can run your Python script. For example:
python your_script.py