“No Module named sqlalchemy” after having just installed it from IPython prompt

久未见 提交于 2021-02-10 05:51:09

问题


I am unable to import sqlalchemy. I searched and found few solutions like installing flask or flask_sqlalchemy etc. None of these helped.

What am I missing?


回答1:


Sometimes, you need to restart ipython for it to find freshly-installed modules.

I believe this holds for modules that add to sys.path.


As per Can I zip all the python standard libs and the python still able to import it? , site.main() should work, too.

It, among other things, scans site-packages directories for .pth files and adds their contents to sys.path. Thanks to the fact that its logic checks for duplicates before adding, it shouldn't clutter sys.path when invoked repeatedly.



来源:https://stackoverflow.com/questions/43494172/no-module-named-sqlalchemy-after-having-just-installed-it-from-ipython-prompt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!