简体   繁体   中英

Can't call functions of imported module

I'm trying to use the z3 module in python. I installed it using pip on windows. However when i try to execute this code

from z3 import *

...

s = Solver()
s.add(c1, c2, c3, c4, c5, c6, c7)
s.model()

I get "NameError: name 'Solver' is not defined".

What I find odd is that importing does not generate an error message, so it should have worked, yet when I try to call different functions they seem to not exist.

Am I doing something completely wrong?

It was an installation Issue the module z3 is actually different from z3-solver (which is the one people in the examples use).

You can install it without Visual Studio Prompts like this: https://github.com/Z3Prover/z3/wiki/Using-Z3Py-on-Windows

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM