<p>从这个问题<a href="https://stackoverflow.com/questions/3221814/why-are-session-methods-unbound-in-sqlalchemy-using-sqlite">Why are session methods unbound in sqlalchemy using sqlite?</a>可以看出,我需要为sessionmaker实例化这个类。</p>
<p>我得到了同样的错误,我假设“fix”可以工作,只是我不知道如何“实例化类”</p>
<p>我的设置代码是根据链接的问题。</p>
<p>从这个问题<a href="https://stackoverflow.com/questions/396856/how-to-instantiate-a-class-in-python">How to instantiate a class in python</a>我可以看出我需要调用类对象,而我错误的假设是:</p>
<pre><code>session = sessionmaker(bind=engine)
</code></pre>
<p>行是实例化。</p>