Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I normally work in python on Windows and I use the dos command where python to make sure that I am using the virtual environments version of python. What is the equivalent command in the linux shell?

Thanks!

share|improve this question

migrated from stackoverflow.com Apr 13 '13 at 21:48

This question came from our site for professional and enthusiast programmers.

    
I think you are looking for command: ps -aux | grep python –  Grijesh Chauhan Apr 13 '13 at 20:01
add comment

2 Answers

up vote 8 down vote accepted

Use which python.


$ which python
/usr/bin/python

C:\Users\anossovp>where python
c:\Python27\python.exe
share|improve this answer
add comment

The thing you are usually looking for is not where Python itself is, but where it's libraries are. For that I would recommend this:

(from within the Python shell)

import sys
import pprint
pprint.pprint(sys.path)

Outside of that you can still do which python naturally.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.