i have installed both python and Z3 and have set PYTHONPATH with the path of Z3 python directory.
I import Z3 by running this, from z3 import *
But after this i am getting a persistent long error message of which ends in the following manner:
File "C:\Program Files\Microsoft Research\Z3-4.1\python\z3core.py", line 34, in init
_lib = ctypes.CDLL(PATH)
File "C:\Python27\lib\ctypes\__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found
Interestingly everything was working till i reinstalled both python and Z3.
Your PATH environment variable should be set to include the bin or the x64 directory in the Z3 installation. If you are using the 64 bit version of Python you should include the x64 directory.
Example:
hello.py .... File "C:\Python27\lib\ctypes__init__.py", line 365, in init self._handle = _dlopen(self._name, mode) WindowsError: [Error 126] The specified module could not be found
set PATH=%PATH%;C:\Program Files (x86)\Microsoft Research\Z3-4.1\bin
hello.py Traceback (most recent call last): .... File "C:\Python27\lib\ctypes__init__.py", line 365, in init self._handle = _dlopen(self._name, mode) WindowsError: [Error 193] %1 is not a valid Win32 application
set PATH=%PATH%;C:\Program Files (x86)\Microsoft Research\Z3-4.1\x64
hello.py hello Z3