added logic for installing from pip or apt