Contents |
Install virtualenv using package manager
sudo [aptitude/yum] install python-virtualenv
Create virtual environment to your OTS root directory with following command. It creates .env directory which will include bin, include and lib directories. When using '--no-site-packages' parameter virtualenv will not inherit any packages from your global site-packages directory.
virtualenv --no-site-packages ENV
Set environment by sourcing activate file from ENV/bin folder.
source ENV/bin/activate
Now 'which python' command should point to your ENV/bin/python file.
Now let's install python packages needed by OTS to virtual environment. Run command
pip install --upgrade minixsv amqplib django configobj
Packages will be installed under ENV/lib/python2.6/site-packages directory.
Install OTS normal way using 'python setup.py install' command under component directory (no need to do it as root).
Now 'which ots_server' should point to ENV/bin/ots_server file, and you can start is as normal user.
To leave virtual environment give command
deactivate
OTS will read configuration files under /etc directory, so configuration files must be copied to there. When starting OTS you need to do it as root, or give write permission for a user write log files and do the flashing. Then you can activate virtualenv in two different terminals and start ots_server and ots_worker.