Use follwoing command:

python -c "import sys; print(sys.prefix)"