4

I thought I could get the version of python3 after typing

python3 -v

in terminal. Instead, I got these:

import _frozen_importlib # frozen
import _imp # builtin
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
# installing zipimport hook
import 'zipimport' # <class '_frozen_importlib.BuiltinImporter'>
# installed zipimport hook
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'posix' # <class '_frozen_importlib.BuiltinImporter'>
import _thread # previously loaded ('_thread')
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import _weakref # previously loaded ('_weakref')
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
# /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/encodings/__pycache__/__init__.cpython-37.pyc matches /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/encodings/__init__.py
# code object from '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/encodings/__pycache__/__init__.cpython-37.pyc'
# /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/__pycache__/codecs.cpython-37.pyc matches /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/codecs.py

After it, I typed

exit()

to leave, it shown

# clear builtins._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# clear sys.__interactivehook__
# clear sys.flags
# clear sys.float_info
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
  1. Can someone explain what the output is supposed to mean?
  2. And why are they appearing?
Nilesh Kesar
  • 387
  • 2
  • 15
Eva
  • 61
  • 4

1 Answers1

5

Python's -v option is for "verbose", meaning it prints detailed debugging info for what is happening under the hood in the interpreter. Try man python or man python3 to see the manual page. It shows that the version is gotten by the --version option (or -V for short).

Levi Lutz
  • 151
  • 5