0

I have installed Z3 on a remote server where I am not Root. I changed the prefix during the installation to my directory where I have write access, The installation went smoothly and now I have two directories in my home directory one for the project and one where I unzipped/build/installed z3. when I want to execute a python script that includes:

 from z3 import *

I receive this error:

ModuleNotFoundError: No module named 'z3'

I think it's a problem related to paths and my python file can't get to the z3 module, I don't know how to fix this especially that python3 was installed by the root and not by me.

basel117
  • 189
  • 1
  • 10
  • 1
    Have you added the directoy where you have installed z3 to your PYTHONPATH environment variable? – FlyingTeller May 27 '19 at 11:55
  • as a **non portable** hack, you can also prepend that line with `sys.path.append('path/to/z3')` – Nullman May 27 '19 at 11:58
  • @basel117 Could you give some additional infos as asked in the comments here? – FlyingTeller May 27 '19 at 12:35
  • no I didn't add them to the pythonpath, I am doing that right now. – basel117 May 27 '19 at 12:44
  • Possible duplicate of [Python error "ImportError: No module named"](https://stackoverflow.com/q/338768/608639), [import error: 'No module named' *does* exist](https://stackoverflow.com/q/23417941/608639), etc. – jww May 27 '19 at 16:34
  • I have added Z3 to PYTHONPATH variable environments as suggested in the last step in this link [ http://www.cs.utexas.edu/users/moore/acl2/manuals/current/manual/index-seo.php/SMT____Z3-INSTALLATION ] but I still can't get my python code to run. how do I check if it was added successfully? – basel117 May 28 '19 at 14:31

1 Answers1

0

One work around for this is by importing packages using their paths, like

from ~/z3_folder import *

Please share if it works.

Divyanshu Srivastava
  • 1,379
  • 11
  • 24