سؤال

I am trying to deploy Django to Amazon Elastic Beanstalk on mac Maverick, according to the official tutorial

After I activated a virtualenv and pip install mysql==1.2.3, the following error appears:

(djangodev)Lee-Jamess-MacBook-Pro:~ h0925473$ pip install mysql-python==1.2.3
Downloading/unpacking mysql-python==1.2.3
  Downloading MySQL-python-1.2.3.tar.gz (70kB): 70kB downloaded
  Running setup.py (path:/private/tmp/djangodev/build/mysql-python/setup.py) egg_info for package mysql-python
    warning: no files found matching 'MANIFEST'
    warning: no files found matching 'ChangeLog'
    warning: no files found matching 'GPL'
Installing collected packages: mysql-python
  Running setup.py install for mysql-python
    building '_mysql' extension
    cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -arch x86_64 -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/local/Cellar/mysql/5.6.17_1/include/mysql -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _mysql.c -o build/temp.macosx-10.9-x86_64-2.6/_mysql.o -Os -g -fno-strict-aliasing
    clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
    clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
    error: command 'cc' failed with exit status 1
    Complete output from command /tmp/djangodev/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/djangodev/build/mysql-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/5_/vv2pw8nd0d53pjdqnrny5l080000gn/T/pip-yeU00T-record/install-record.txt --single-version-externally-managed --compile --install-headers /tmp/djangodev/include/site/python2.6:
    running install

running build

running build_py

creating build

creating build/lib.macosx-10.9-x86_64-2.6

copying _mysql_exceptions.py -> build/lib.macosx-10.9-x86_64-2.6

creating build/lib.macosx-10.9-x86_64-2.6/MySQLdb

copying MySQLdb/__init__.py -> build/lib.macosx-10.9-x86_64-2.6/MySQLdb

copying MySQLdb/converters.py -> build/lib.macosx-10.9-x86_64-2.6/MySQLdb

copying MySQLdb/connections.py -> build/lib.macosx-10.9-x86_64-2.6/MySQLdb

copying MySQLdb/cursors.py -> build/lib.macosx-10.9-x86_64-2.6/MySQLdb

copying MySQLdb/release.py -> build/lib.macosx-10.9-x86_64-2.6/MySQLdb

copying MySQLdb/times.py -> build/lib.macosx-10.9-x86_64-2.6/MySQLdb

creating build/lib.macosx-10.9-x86_64-2.6/MySQLdb/constants

copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.9-x86_64-2.6/MySQLdb/constants

copying MySQLdb/constants/CR.py -> build/lib.macosx-10.9-x86_64-2.6/MySQLdb/constants

copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.9-x86_64-2.6/MySQLdb/constants

copying MySQLdb/constants/ER.py -> build/lib.macosx-10.9-x86_64-2.6/MySQLdb/constants

copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.9-x86_64-2.6/MySQLdb/constants

copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.9-x86_64-2.6/MySQLdb/constants

copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.9-x86_64-2.6/MySQLdb/constants

running build_ext

building '_mysql' extension

creating build/temp.macosx-10.9-x86_64-2.6

cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -arch x86_64 -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/local/Cellar/mysql/5.6.17_1/include/mysql -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _mysql.c -o build/temp.macosx-10.9-x86_64-2.6/_mysql.o -Os -g -fno-strict-aliasing

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: command 'cc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /tmp/djangodev/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/djangodev/build/mysql python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/5_/vv2pw8nd0d53pjdqnrny5l080000gn/T/pip-yeU00T-record/install-record.txt --single-version-externally-managed --compile --install-headers /tmp/djangodev/include/site/python2.6 failed with error code 1 in /private/tmp/djangodev/build/mysql-python
Storing debug log for failure in /Users/h0925473/.pip/pip.log

When I further startproject with Django and pip freeze > requirements.txt: the tutorial mentioned that the requirements.txt should contain:

Django==1.4.1
MySQL-python==1.2.3

but my requirements.txt is only:

Django==1.4.1
wsgiref==0.1.2

Does this mean my installation of MySql has failed? If so, how can i fixed it?

هل كانت مفيدة؟

المحلول

From this

Try

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install mysql-python==1.2.3
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top