当前位置:网站首页>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/
边栏推荐
- Unit DLU of resource editor
- 1. Mx6u-alpha development board (buzzer experiment)
- Virtual machine win7 system installation vmtool
- vlan技术
- Applet wonderful bug update~
- Bypass using the upper limit of the maximum number of regular backtracking
- Synthesis route of ALA PNA alanine modified PNA peptide nucleic acid | AC ala PNA
- Microservice architecture | service monitoring and isolation - [sentinel] TBC
- The difference between map and flatmap in stream
- [msp430g2553] graphical development notes (2) system clock and low power consumption mode
猜你喜欢
![2019 Hangdian multi school first 6581 vacation [thinking]](/img/38/5a74d3ef346d6801f9da8fd3a4b23a.png)
2019 Hangdian multi school first 6581 vacation [thinking]

ATL container - catlmap, crbmap
![[training Day9] maze [line segment tree]](/img/56/e8458245fe564821740ab94ece37a4.png)
[training Day9] maze [line segment tree]

The U.S. economy continues to be weak, and Microsoft has frozen recruitment: the cloud business and security software departments have become the hardest hit

Login Huawei device in SSH mode

Elastomer simulation (elasticity)

Usage and introduction of MySQL binlog
![[training Day9] rotate [violence] [thinking]](/img/b9/598dd0dffb9c82230f43484f9c8a1e.png)
[training Day9] rotate [violence] [thinking]

Huawei set up login with account and password

147-利用路由元信息设置是否缓存——include和exclude使用——activated和deactivated的使用
随机推荐
870. Approximate number
Huawei set up login with account and password
Fluoronisin peptide nucleic acid oligomer complex | regular active group alkyne, SH thiol alkynyl modified peptide nucleic acid
Lunch break train & problem thinking: on multidimensional array statistics of the number of elements
Please ask a question. Follow the quick start method. After creating the table, the Flink SQL queries and displays the table structure, but there is an error when it exceeds the limit. What should we
Each blogger needs to ask himself seven basic questions
Lunch break train & problem thinking: thinking about the problem of converting the string formed by hour: minute: second to second
(posted) differences and connections between beanfactory and factorybean
Monotone stack and monotone queue (linear complexity optimization)
[msp430g2553] graphical development notes (2) system clock and low power consumption mode
01 | opening words: teach you to build a blog website hand in hand
Write a batch and start redis
[training Day10] silly [simulation] [greed]
Wechat stores build order pages and automatically grab tickets
Home Assistant中接入博联WiFi智能遥控
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
01 | 开篇词:手把手教你搭建一个博客网站
MySQL advanced 2
In the era of new knowledge economy, who is producing knowledge?
Covid-19-20 - basic method of network segmentation based on vnet3d