2

I know I can manually install a concrete version of a library in Google Colab (see When I install older version of scikit-learn in Google Colab, it still import the newest version).

However, how can I know which version of a library I am using? I am trying to know which version of Z3 I am using.

I tested the following:

pip install z3-solver
import z3
z3 -version

But I get the following error: name 'version' is not defined

In my (Unix) machine, it suffices to ask: z3 -version (see Z3 -smt2 -in: Get Z3 version)

This question is extensible to any library.

Theo Deep
  • 666
  • 4
  • 15

2 Answers2

2

You should use the dunder notation

z3.__version__

EDIT - for pip package z3-solver

you should use

import z3
z3.get_version_string()

as seen here

olirwin
  • 545
  • 5
  • 21
0

I am trying to know which version of Z3 I am using.(...)This question is extensible to any library.

Then do not rely on library to report that, but pip. You might simply instruct pip to list all installed modules and find version of interesting one, that is

pip install z3-solver
pip list
Daweo
  • 31,313
  • 3
  • 12
  • 25