-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot import z3 in Python #904
Comments
@delcypher there's got to be something basic? |
@wenting-zhao I thing the easiest way to import the z3 package is by installing z3 via |
@wenting-zhao @NikolajBjorner Thanks to the work of @rhelmot The directory |
This is very much appreciated. It's been a while, so I don't remember what happened there exactly. I think I didn't build it properly, but somehow z3 did get installed under the |
Hi Everyone, I simply ran
If I import z3 in python 2.7, Best |
It strikes me as incredibly likely that there are some macOS specific packaging bugs in the Python distribution. I have never been able to test the setup on macOS, nor do I have the ability to. |
@hectorpla you have to do |
That's not the problem. The |
Yes, those relative imports are in the API. I have a sneaking suspicion that this is also the root cause of some of our doctests not working on some platforms, under some configurations, and some versions of python (I haven't seen a pattern yet). @rhelmot: git blames you for these lines of code; do you remember what made this change necessary? |
@rhelmot I wouldn't be surprised if there are some macOS specific packaging bugs in the Python distribution. This happens quite often every time I upgrade my system (macOS Sierra is new). I'd be happy to look at it more and test the setup on macOS if I can steadily produce the bug. However, everything seems to be very well-fixed after I cleaned and rebuilt it. @hectorpla which version of Mac OS are you running? How did you build z3 for python2, exactly? Did you run |
@wenting-zhao I am running on Yosmite 10.10.5 and I installed z3 by the command |
Finally I successfully import z3. It failed because I accidentally added the z3 directory to python's system path. Thanks. |
Hi,
(This is an error on macOS Sierra, and I'm running Python 2.7.10)
When I tried importing the z3 package, I got this error:
A quick search on Google tells me that relative imports don't work in this case, and so I fixed this issue by adding the absolute path to where z3.py is stored:
However, it seems like all files are doing relative imports, and adding the above piece of code in every file doesn't sound like a solution. Does anyone run into this as well? Might there be a fix?
Thanks!
The text was updated successfully, but these errors were encountered: