Search code examples
pythonlinuxserverz3

fixing the path so python can recognize z3 modules


I have successfully installed z3 on a remote server where I am not root. when I try to run my python code I get :

ModuleNotFoundError: No module named 'z3'

I understand that I have to add it to PYTHONPATH in order to work and so I went ahead and done that like this:

export PYTHONPATH=$HOME/usr/lib/python-2.7/site-packages:$PYTHONPATH

I still get the same issue though, how can I verify that it was correctly added to the variables environment? what am i doing wrong?


Solution

  • Did you pass the --python flag when you called scripts/mk_make.py?

    See the instructions on https://github.com/Z3Prover/z3/blob/master/README.md on how to exactly enable Python (about all the way down in that page). Here's an example invocation:

    python scripts/mk_make.py --prefix=/home/leo --python --pypkgdir=/home/leo/lib/python-2.7/site-packages
    

    Change the directories appropriately, of course.