当前位置:网站首页>Modulenotfounderror: no module named 'pysat.solvers' (resolved)
Modulenotfounderror: no module named 'pysat.solvers' (resolved)
2022-07-24 20:21:00 【Han and Autumn_】
problem
Try using the following code to learn pysat Use , Reference resources
from pysat.solvers import Solver
def solve_sat_from_clauses(clauses):
''' use g3 solver to solve the clauses list >>>> Parameters: :clauses: clauses that should be satisified >>>> Return: :solutions: all possible solutions to the sat problem '''
solutions = []
with Solver(name='g3') as s1: # define a g3 solver
for clause in clauses:
s1.add_clause(clause) # add clauses
if s1.solve():
for solution in s1.enum_models(): # enumerate all possible solutions
solutions.append(solution)
return solutions
if __name__ == "__main__":
c = [[1,-2],[2,-1]]
# c = [[1, -2], [-1]]
s = solve_sat_from_clauses(c)
print(s)
Report errors
ModuleNotFoundError: No module named 'pysat.solvers'
reason
Refer to the following , But it doesn't work
https://github.com/pysathq/pysat/issues/96
The original installation scheme is pip install pysat, Later, I found that this should not be installed , This pysat The home page of is https://pysat.readthedocs.io/en/latest/index.html, Its pipi The address is https://pypi.org/project/pysat/
Solution
pysat.solvers What is used pysat by https://pysathq.github.io/, The installation method is pip install python-sat, Its pipi The address is https://pypi.org/project/python-sat/
边栏推荐
- Software testing interview tips | if you don't receive the offer, I'll wash my hair upside down
- [German flavor] safety: how to provide more protection for pedestrians
- [training Day10] tree [interval DP]
- Google's display of Chrome browser icons was abandoned, and it was intended to be a small rocket
- Lunch break train & problem thinking: on multidimensional array statistics of the number of elements
- SSL Error: Unable to verify the first certificate
- ATL container - catlmap, crbmap
- Leetcode 300 longest increasing subsequence (greedy + binary search for the first element subscript smaller than nums[i]), leetcode 200 island number (deep search), leetcode 494 target sum (DFS backtr
- Wechat applet -that.setdata ({}) set complex field data
- Call Baidu AI open platform to realize image and character recognition
猜你喜欢

TCP sliding window, singleton mode (lazy and hungry) double checked locking / double checked locking (DCL)

Leetcode 146: LRU cache

Richview table table alignment

Actual measurement of Qunhui 71000 Gigabit Network

Lunch break train & problem thinking: thinking about the problem of converting the string formed by hour: minute: second to second

Connect the smart WiFi remote control in the home assistant

Alibaba cloud technology expert Yang Zeqiang: building observable capabilities on elastic computing cloud

Install MySQL 5.7.37 on windows10

Google's display of Chrome browser icons was abandoned, and it was intended to be a small rocket

Home Assistant中接入博联WiFi智能遥控
随机推荐
Setting up a dual machine debugging environment for drive development (vs2017)
微服务架构 | 服务监控与隔离 - [Sentinel] TBC...
Ask a question: is there an error msg = ora-04036: instance usage when using CDC to monitor oracle
[training Day8] tent [mathematics] [DP]
Synthesis of peptide nucleic acid PNA labeled with heptachydrin dye cy7 cy7-pna
[training Day8] interesting number [digital DP]
Leetcode 48 rotating image (horizontal + main diagonal), leetcode 221 maximum square (dynamic programming DP indicates the answer value with ij as the lower right corner), leetcode 240 searching two-d
(posted) differences and connections between beanfactory and factorybean
[training Day10] point [enumeration] [bidirectional linked list]
872. Maximum common divisor
Mass modify attribute values in objects in JS
(forward) usage of PostMessage
Storage category
Valdo2021 - vascular space segmentation in vascular disease detection challenge (2)
01 | 开篇词:手把手教你搭建一个博客网站
Batch download files from the server to the local
Microservice architecture | service monitoring and isolation - [sentinel] TBC
Huawei set up login with account and password
Thinking of @requestbody caused by hi and hello requests
870. Approximate number