System environment: MAC OSX 10.9.2
Python version: 2.7.5
The new beginning of the RMBP, with the Python environment, but put it into the production environment, there are various problems, first of all, the most deadly, is the installation module problems, resulting in the development has not been normal, the following is my installation of the Python module, the appearance and resolution, summarized as follows, Hope to be helpful to the later (take Mysql-python example, install PIL also encountered the same problem):
(1) Whether using the Easy_install installation module or downloading the installation package, the sudo python setup.py build installation will appear:
******
Error:command ' CC ' failed with exit status 1
Clang:error:unknown argument: '-mno-fused-madd ' [-wunused-command-line-argument-hard-error-in-future]
Clang:note:this'll be a hard error (cannot is downgraded to a warning) in the future
Error:command ' CC ' failed with exit status 1
After a series of searches: Http://www.tuicool.com/articles/zI7Vzu, seemingly mac The OS Xcode from 5.1 to the compiler specifies that for an unknown parameter incoming to be treated as error, we need to downgrade the error to warning using archflags, so the final installation command should look like this:
sudo archflags=-wno-error=unused-command-line-argument-hard-error-in-future easy_install MySQL-python
So, the problem is solved, successfully installed on the Mysql-python
(2) Although the installation of Mysql-python, in the code development process, run the code, the problem arises again:
******
Import MySQLdb
File "build/bdist.macosx-10.9-intel/egg/mysqldb/__init__.py", line A, in <module>
File "build/bdist.macosx-10.9-intel/egg/_mysql.py", line 7, <module>
File "build/bdist.macosx-10.9-intel/egg/_mysql.py", line 6, in __bootstrap__
Importerror:dlopen (/users/kris/.python-eggs/mysql_python-1.2.5-py2.7-macosx-10.9-intel.egg-tmp/_mysql.so, 2): Library not Loaded:libmysqlclient.18.dylib
Referenced from:/users/kris/.python-eggs/mysql_python-1.2.5-py2.7-macosx-10.9-intel.egg-tmp/_mysql.so
Reason:image not found
After looking, I added two symbolic links (soft links):
sudo ln-s/usr/local/mysql/lib/libmysqlclient.18.dylib/usr/lib/libmysqlclient.18.dylib
sudo ln-s/usr/local/mysql/lib/usr/local/mysql/lib/mysql
Run the program again and the problem is resolved.
MAC OSX installs MySQL module problem with Python