Thursday, January 17, 2019

Installing z3py

The Z3 Python API requires the following environment variables to be set up.
  • The PATH or LD_LIBRARY_PATH variables needs to poin to the directory containing "libz3.dll" or "libz3.so"
  • The PYTHONPATH environment variable needs to point to the directory that contains "z3/z3.py"
If you obtained the Z3 distribution as part of our binary release zip files, which you unzipped into a directory called "MYZ3", then follow these instructions to update the environment variables:
Windows:
set PATH=%PATH%;MYZ3\bin
set PYTHONPATH=MYZ3\bin\python
Linux:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:MYZ3/bin
export PYTHONPATH=MYZ3/bin/python
On Ubuntu, even if you have installed z3py through `apt install python-z3`, you still need to manually setup the paths as follows:
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
export PYTHONPATH=/usr/lib/python2.7/dist-packages/z3