Allow VirtualEnv to use existing system-wide packages if they already exist.
Change-Id: I6f39178d56e81affea0bee7b9065bef66712ddaa
Signed-off-by: Carsten Koester <ckoester@cisco.com>
- install virtualenv
- generate environment using virtualenv:
# cd $ROOT
- # virtualenv env
+ # virtualenv --system-site-packages env
# source env/bin/activate
- install python requirements for this project by executing:
# pip install -r requirements.txt
sudo apt-get -y install python-virtualenv
-virtualenv env
+virtualenv --system-site-packages env
. env/bin/activate
pip install -r requirements.txt
sudo apt-get -y update
sudo apt-get -y install libpython2.7-dev python-virtualenv
-virtualenv env
+virtualenv --system-site-packages env
. env/bin/activate
echo pip install
fi
-virtualenv env
+virtualenv --system-site-packages env
. env/bin/activate
echo pip install
fi
-virtualenv env
+virtualenv --system-site-packages env
. env/bin/activate
echo pip install
ssh = SSH()
ssh.connect(node)
(ret_code, stdout, stderr) = ssh.exec_command(
- 'cd {0} && rm -rf env && virtualenv env && . env/bin/activate && '
+ 'cd {0} && rm -rf env && virtualenv --system-site-packages env && . env/bin/activate && '
'pip install -r requirements.txt'
.format(con.REMOTE_FW_DIR), timeout=100)
if 0 != ret_code:
logger.trace("{}".format(timeout))
ssh = SSH()
ssh.connect(node)
- cmd = ("cd {}; virtualenv env && " +
+ cmd = ("cd {}; virtualenv --system-site-packages env && " +
"export PYTHONPATH=${{PWD}}; " +
". ${{PWD}}/env/bin/activate; " +
"resources/traffic_scripts/{} {}") \