Install¶
To install QuNetSim, we recommend using a Python Virtual environment. We give the instructions below on how to install the environment for each operating system.
Via pip¶
To install QuNetSim via pip: pip install qunetsim
. The Python package comes with a script called template
.
Simply type template
and follow the instructions to generate an example template.
Linux / Mac OS X¶
Make sure you have python 3.5 or greater. For Mac OS users, one should have terminal commands installed.
Download / Clone the Git repository.
git clone git@github.com:tqsd/QuNetSim.git
Here we use a Python virtual environment located at the same directory level as where the project is cloned (i.e. dont change directories after running step 1). Instructions for setting this up:
python3 -m venv venv
source ./venv/bin/activate
pip install --upgrade pip
pip install -r ./QuNetSim/requirements.txt
To set the correct Python path run:
export PYTHONPATH=$PYTHONPATH:$PWD/QuNetSim/
After installing, you can use the templating script to get started. It will generate a file with the common structure of a QuNetSim use.
python3 ./QuNetSim/templater.py
The template will perform a small example which can be run:
python3 <name of your file>.py
Windows¶
Make sure you have python 3.5 or greater.
Download / Clone the Git repository.
git clone git@github.com:tqsd/QuNetSim.git
Here we use a Python virtual environment located at the same directory level as where the project is cloned (i.e. dont change directories after running step 1). Instructions for setting this up:
python3 -m venv venv
.\venv\Scripts\activate
python -m pip install --upgrade pip
python -m pip install -r .\QuNetSim\requirements.txt
To set the correct Python path we need to set the
PYTHONPATH
system variable:Open System Properties -> Advanced
Click “Environment Variables”
In the System Variable area (the bottom part)
If the
PYTHONPATH
variable already exists then addC:\<PATH_TO_QUNETSIM>\QuNetSim
to the path, replacing<PATH_TO_QUNETSIM>
with the path to where QuNetSim is located.Otherwise, click New and add a variable
PYTHONPATH
with valueC:\<PATH_TO_QUNETSIM>\QuNetSim
, replacing<PATH_TO_QUNETSIM>
with the path to where QuNetSim is located.
After installing, you can use the templating script to get started. It will generate a file with the common structure of a QuNetSim use.
python3 .\QuNetSim\templater.py
The template will perform a small example which can be run:
python3 <name of your file>.py