Infos on virtual environments: https://www.dabapps.com/blog/introduction-to-pip-and-virtualenv-python/
Install pip
:
curl -O https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
rm get-pip.py
Install virtualenv
and virtualenvwrapper
:
sudo pip install virtualenv
sudo pip install virtualenvwrapper
Add setup code for virtualenvwrapper
to shell startup file:
echo "export WORKON_HOME=$HOME/.virtualenvs && source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc
source ~/.bashrc
mkvirtualenv evaluation
Now, the package should be installed in the virtualenv and you can use it.
To activate the environment, type:
workon evaluation
Install evo and its dependencies inside the virtual environment:
pip install evo --upgrade
# or alternatively from source:
cd <evo> # go to evo base source folder with setup.py
pip install . --upgrade
Important: if you want to use ROS bagfiles in the virtual environment, run this too:
pip install catkin_pkg rospkg pyyaml
For some reason these packages are not found in a virtual environment even if you have a proper ROS installation (see ROS forums)
Check if evo is installed correctly by running:
evo
To leave the virtualenv, close the shell or type:
deactivate
To delete the environment:
rmvirtualenv evaluation
Unfortunately, tab command completion with the argcomplete might not work immediately in a virtual environment. You might need to install argcomplete outside of your virtualenv and run activate-global-python-argcomplete
to make it work globally on your machine.