How do I check what version of Python is running my script?

前端 未结 22 2087
醉话见心
醉话见心 2020-11-22 04:11

How can I check what version of the Python Interpreter is interpreting my script?

22条回答
  •  攒了一身酷
    2020-11-22 04:47

    To verify the Python version for commands on Windows, run the following commands in a command prompt and verify the output

    c:\>python -V
    Python 2.7.16
    
    c:\>py -2 -V
    Python 2.7.16
    
    c:\>py -3 -V
    Python 3.7.3
    

    Also, To see the folder configuration for each Python version, run the following commands:

    For Python 2,'py -2 -m site'
    For Python 3,'py -3 -m site'
    

提交回复
热议问题