我在我的Mac Lion上設置了python/numpy/scipy/matplotlib/mysql。我首先安裝了Python 2.7.3和mysqldb。然後我更新到4.3.3的XCode和所使用的ScipySuperpack在這一點上,我能夠導入蟒蛇幾個包無事安裝numpy的,SciPy的等Mac Lion Python安裝:Matplotlib以mysql錯誤結尾
但matplotlib模具如下:
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import scipy
>>> import _mysql
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/MySQL_python-1.2.3-py2.7-macosx-10.6-intel.egg/_mysql.py:3:
UserWarning: Module _mysql was already imported from
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-
packages/MySQL_python-1.2.3-py2.7-macosx-10.6-intel.egg/_mysql.pyc, but
/Users/myname/pypy is being added to sys.path
>>> import matplotlib
Error 2002: Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2)
對不起,如果問題是基本的,但我不明白的警告,或者它可能有什麼 做最終的錯誤...
請參閱[上一個問題](http://stackoverflow.com/questions/1448429/how-to-install-mysqldb- python-data-access-library-to-mysql-on-mac-os-x),特別是其中一個答案中的第9步。 – cosmosis 2012-07-10 09:24:56
非常感謝!看起來像我可以導入matplotlib很好,只要我不在我用來安裝mysqldb的目錄中!奇怪的...... – randoo 2012-07-10 16:01:49