I find this especially useful when using pyenv
or virtualenv
.
Asked
Active
Viewed 739 times
0

klenwell
- 6,978
- 4
- 45
- 84
-
@martijn-pieters Question linked as possible duplicate doesn't really provide a single command line command. Top answer requires dipping into the interpreter. – klenwell Jul 20 '14 at 00:28
-
Combining that into a one-liner is not really all that hard or novel. – Martijn Pieters Jul 20 '14 at 00:29
-
This is the simplest answer to the quesiton as asked. If the OP had somethign else in mind, perhaps he should update the question. – Mawg says reinstate Monica Oct 11 '16 at 16:49
1 Answers
1
This works for me:
$ python -c "import sys; print(sys.executable)"
Sample output:
/home/klenwell/.pyenv/versions/2.7.7/bin/python

klenwell
- 6,978
- 4
- 45
- 84