Arthur Camberlein >> SEO & Data articles >> Difference between python --version and python -v

Difference between python --version and python -v

Written by Arthur Camberlein | Published on & updated on

Difference between python --version and python -v. These two commands have completely different purposes:

python --version

  • Shows the Python interpreter's version number
  • Example output: Python 3.9.7
  • This is the standard way to check which version of Python you're running
  • It's equivalent to python -V (capital V)

python -v

  • Activates verbose mode, showing detailed information about module imports and initialization
  • Produces extensive output about every module being loaded as Python starts up
  • Used primarily for debugging import and initialization issues
  • The output is much longer and more technical

Example:

If you run python -v even with a simple script, you'll see many lines like:


# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
import encodings # directory /usr/lib/python3.9/encodings
...
# many more import statements
...

If you just need to check your Python version, use python --version or python -V.

Back to blog

Learn more with the article FAQ

Difference between python --version and python -v - FAQs

Blog post topic:  Data, Python: the language and the tool to help you!

Written by

With more than 10 years of experience in Marketing, Web Marketing and SEO, Arthur is specialized in Tech SEO and Data Analysis. He is currently working at Shopify, but all the views on this blog & website are his own.

Related Articles