Python kann ein Modul finden ... und dann kann es nicht

Ich werde Python endlich auf Hochtouren bringen, aber aus irgendeinem Grund habe ich ein Problem, bei dem Python ein Modul in der interaktiven CLI finden kann und dann nicht, wenn ich ein Skript schreibe. Das Modul ist speziell mysql.connector in /Library/Python/2.7/site-packages. Wie Sie in der interaktiven CLI-Sitzung sehen können, wird mysql.connector einwandfrei importiert. Das Echo der Datei sys.path zeigt 'Library / Python / 2.7 / site-packages'

Hier ist ein neues CLI-Fenster (ich bin auf einem Mac 10.10). Hinweis: Wenn ich mich anfangs anmelde, werde ich in mein Home-Verzeichnis geführt, was natürlich normal ist.

wilkie:~ wilkie$ which python
/usr/bin/python
wilkie:~ wilkie$ python
Python 2.7.6 (default, Sep  9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import mysql.connector
>>> sys.path
['', '/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg', '/Library/Python/2.7/site-packages/cx_Oracle-5.2-py2.7-macosx-10.10-intel.egg', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages']
>>>

So habe ich nur in ein anderes Verzeichnis gewechselt ...

cd /Users/wilkie/Projects/dataparse

und einfach so ... es kann mysql.connector nicht finden

wilkie:dataparse wilkie$ python
Python 2.7.6 (default, Sep  9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg', '/Library/Python/2.7/site-packages/cx_Oracle-5.2-py2.7-macosx-10.10-intel.egg', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages']
>>> import mysql.connector
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "mysql.py", line 1, in <module>
    import mysql.connector
ImportError: No module named connector
>>>

Ich bin offiziell ratlos und habe keine Ahnung, warum das passiert. Ist das schon mal jemandem begegnet?

Antworten auf die Frage(4)

Ihre Antwort auf die Frage