I cannot import sqlalchemy without getting ImportError: No module named sqlalchemy

Viewed 2427

I'm on Mac OSX and I cannot import sqlalchemy.

Here is what I did. I ran:

$ pip install sqlalchemy
Requirement already satisfied: sqlalchemy in /usr/local/lib/python2.7/site-packages (1.3.1)

I verified that sqlalchemy was installed by running:

$ ls /usr/local/lib/python2.7/site-packages | grep sqlalchemy
flask_sqlalchemy
sqlalchemy

I opened my python interpreter and ran:

$ python
Python 2.7.10 (default, Feb  7 2017, 00:08:15)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlalchemy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named sqlalchemy
>>>

So I thought this might be a case where my system has two python interpreters and only one can see the package. I ran a which command like so...

$ which -a python
/usr/bin/python

So I only have one python interpreter installed, sqlalchemy is installed, but I cannot import it? Any tips?

0 Answers
Related