Find where python is installed (if it isn't default dir)

后端 未结 11 1440
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-04 06:09

Python is on my machine, I just don\'t know where, if I type python in terminal it will open Python 2.6.4, this isn\'t in it\'s default directory, there surely is a way of f

11条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-04 06:46

    You should be able to type "which python" and it will print out a path to python.

    or you can type:

    python
    >>> import re
    >>> re.__file__
    

    and it will print a path to the re module and you'll see where python is that way.

提交回复
热议问题