2

screenshot

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?

ivan_pozdeev
  • 33,874
  • 19
  • 107
  • 152
Arvind Kandaswamy
  • 1,821
  • 3
  • 21
  • 30

1 Answers1

4

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.

ivan_pozdeev
  • 33,874
  • 19
  • 107
  • 152