当前位置:网站首页>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/
边栏推荐
- Analysis of xmldecoder parsing process
- Introduction to fastdfs high availability
- Todolist case
- Mysql8 doesn't seem to support MyISAM partition tables. Does polardb-x support MyISAM partition tables?
- SSL Error: Unable to verify the first certificate
- Make Huawei router into FTP server (realize upload and download function)
- Monotone stack and monotone queue (linear complexity optimization)
- 01 | opening words: teach you to build a blog website hand in hand
- Functional test of redisgraph multi active design scheme
- [training Day9] light tank [dynamic planning]
猜你喜欢

Student achievement management system based on PHP

Safe way -- Analysis of single pipe reverse connection back door
![[shader realizes the flicker effect of three primary colors of television signal _shader effect Chapter 5]](/img/ca/fa87bc199f3aefebddf6eb58784dc7.png)
[shader realizes the flicker effect of three primary colors of television signal _shader effect Chapter 5]

Unity2d~ game practice of decrypting Zhou mu (completed in three days)

TCP sliding window, singleton mode (lazy and hungry) double checked locking / double checked locking (DCL)
![[training Day10] linear [mathematics] [thinking]](/img/bf/0082dbe88c579bbb7adc014c60a0be.png)
[training Day10] linear [mathematics] [thinking]

ATL container - catlmap, crbmap

Substr and substring function usage in SQL

Xiaomi 12s ultra products are so powerful, but foreigners can't buy Lei Jun: first concentrate on the Chinese market

Rhodamine B labeled PNA | rhodamine b-pna | biotin modified PNA | biotin modified PNA | specification information
随机推荐
【LeetCode】1184. 公交站间的距离
1. Mx6u-alpha development board (buzzer experiment)
《自尊的6大支柱》自尊来源于自身的感受
Framework API online viewing source code
01 | opening words: teach you to build a blog website hand in hand
Pix2seq: Google brain proposes a unified interface for CV tasks!
Write a batch and start redis
[training Day10] point [enumeration] [bidirectional linked list]
MySQL advanced
Click the button to return to the top smoothly
Leetcode 206 reverse linked list, 3 longest substring without repeated characters, 912 sorted array (fast row), the kth largest element in 215 array, 53 largest subarray and 152 product largest subarr
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
Near infrared dye cy7.5 labeling PNA polypeptide experimental steps cy7.5-pna|188re labeling anti gene peptide nucleic acid (agpna)
Maya coffee machine modeling
In the era of new knowledge economy, who is producing knowledge?
English grammar_ Demonstrative pronoun this / these / that / those
Lights of thousands of families in the year of xinchou
Substr and substring function usage in SQL
[leetcode] 1184. Distance between bus stops
英文翻译中文常见脏话