I have a problem installing the lxml in my mavericks machine.
I tried all possibilities by installing the prebuild binaries using
normal pip
pip with static deps
and Building
Current version in normal model
Current version with static deps
Older version in normal mode
Older version with static deps
and always end up in this error.
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
here the detailed message
copying /Users/mangoreader/work/lxml-3.3.4/build/tmp/libxml2/include/libxslt/xsltutils.h -> build/lib.macosx-10.9-intel-2.7/lxml/includes/libxslt
running build_ext
building 'lxml.etree' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -arch x86_64 -arch i386 -pipe -I/Users/mangoreader/work/lxml-3.3.4/build/tmp/libxml2/include -I/Users/mangoreader/work/lxml-3.3.4/build/tmp/libxml2/include/libxml2 -I/Users/mangoreader/work/lxml-3.3.4/build/tmp/libxml2/include/libxslt -I/Users/mangoreader/work/lxml-3.3.4/build/tmp/libxml2/include/libexslt -I/Users/mangoreader/work/lxml-3.3.4/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.9-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace
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
Also when i tried installing cython , i am getting the same error
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
detailed log here
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c /private/var/folders/1z/7lv1qq457qxbhkgpt1fk9sdc0000gn/T/pip_build_mangoreader/cython/Cython/Plex/Scanners.c -o build/temp.macosx-10.9-intel-2.7/private/var/folders/1z/7lv1qq457qxbhkgpt1fk9sdc0000gn/T/pip_build_mangoreader/cython/Cython/Plex/Scanners.o
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 /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/1z/7lv1qq457qxbhkgpt1fk9sdc0000gn/T/pip_build_mangoreader/cython/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/1z/7lv1qq457qxbhkgpt1fk9sdc0000gn/T/pip-0akrMB-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/1z/7lv1qq457qxbhkgpt1fk9sdc0000gn/T/pip_build_mangoreader/cython
Storing debug log for failure in /Users/mangoreader/Library/Logs/pip.log
I am totally struck here. It seems this is something to do with the version conflict with gcc or libxml. But i could't figure out what. Any help much appreciated.
SOLVED
As per this SO post clang error: unknown argument: '-mno-fused-madd' (python package installation failure), this can be fixed by setting up this following env variables
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
I am sure that by that that you sorted it out, but in case someone else needs it, install XCode and command line tools and just run
pip install lxml
It will work, may take a little time.
Related
I am trying to install a python package called numba. I want to install it for python2.7, so when I run sudo pip2.7 install numba, it gives a following message. Can anyone let me know what the issue is? Thank you.
copying numba/tests/pycc_distutils_usecase/source_module.py -> build/lib.macosx-10.13-intel-2.7/numba/tests/pycc_distutils_usecase
running build_ext
building 'numba._dynfunc' extension
C compiler: cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe
creating build/temp.macosx-10.13-intel-2.7
creating build/temp.macosx-10.13-intel-2.7/numba
compile options: '-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
cc: numba/_dynfuncmod.c
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.13-intel-2.7/numba/_dynfuncmod.o -o build/lib.macosx-10.13-intel-2.7/numba/_dynfunc.so
ld: in '/usr/local/lib/libunwind.dylib', file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libunwind.dylib for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: in '/usr/local/lib/libunwind.dylib', file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libunwind.dylib for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: Command "cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.13-intel-2.7/numba/_dynfuncmod.o -o build/lib.macosx-10.13-intel-2.7/numba/_dynfunc.so" failed with exit status 1
----------------------------------------
Command "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools,
tokenize;__file__='/private/tmp/pip-build-mt0h4y/numba/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))"
install --record /tmp/pip-yCTE4v-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-mt0h4y/numba
this worked for me
env ARCHFLAGS="-arch x86_64" pip install python-binance
I was trying to install zbar on my Macbook.
When I execute command pip install zbar (after brew install zbar) Exception is thrown as below:
Collecting zbar
Using cached zbar-0.10.tar.bz2
Installing collected packages: zbar
Running setup.py install for zbar
building 'zbar' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c zbarmodule.c -o build/temp.macosx-10.11-intel-2.7/zbarmodule.o
In file included from zbarmodule.c:24:
./zbarmodule.h:26:10: fatal error: 'zbar.h' file not found
#include <zbar.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/var/folders/hx/jbnxkn396zs34xn3fv10tjf40000gn/T/pip-build-PlQauK/zbar/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/hx/jbnxkn396zs34xn3fv10tjf40000gn/T/pip-0yRA4D-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'zbar' extension
creating build
creating build/temp.macosx-10.11-intel-2.7
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c zbarmodule.c -o build/temp.macosx-10.11-intel-2.7/zbarmodule.o
In file included from zbarmodule.c:24:
./zbarmodule.h:26:10: fatal error: 'zbar.h' file not found
#include <zbar.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/var/folders/hx/jbnxkn396zs34xn3fv10tjf40000gn/T/pip-build-PlQauK/zbar/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/hx/jbnxkn396zs34xn3fv10tjf40000gn/T/pip-0yRA4D-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /var/folders/hx/jbnxkn396zs34xn3fv10tjf40000gn/T/pip-build-PlQauK/zbar
There is a similar question, However the answers are not helpful in my case.
I also tried another way to install according to this link
However the same error occurred when I type python setup.py install
running install
running build
running build_ext
building 'zbar' extension
creating build
creating build/temp.macosx-10.11-intel-2.7
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c zbarmodule.c -o build/temp.macosx-10.11-intel-2.7/zbarmodule.o
In file included from zbarmodule.c:24:
./zbarmodule.h:26:10: fatal error: 'zbar.h' file not found
#include <zbar.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
I had the same problem, and I run conda install zbar, after that, the error disappeared.
I am unable to install MySQL-Python on Mavericks with sudo pip install MySQL-Python
I did
export CPPFLAGS=-Qunused-arguments
and
export CFLAGS=-Qunused-arguments before running the command, but I still ran into this same error.
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.9-intel-2.7
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -arch x86_64 -arch i386 -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/Cellar/mysql/5.6.15/include/mysql -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.9-intel-2.7/_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 /usr/bin/python -c "import setuptools;__file__='/private/tmp/pip-build-root/mysql-python/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-_UV3aF-record/install-record.txt --single-version-externally-managed failed with error code 1 in /private/tmp/pip-build-root/mysql-python
Run the following before pip install...
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
Ok, here's what I did:
sudo CFLAGS=-Qunused-arguments CPPFLAGS=-Qunused-arguments python setup.py build
then same thing, but 'install' instead of build
I'm having major issues this morning trying to install mysql-python connector on the Mac.
The issues is down to a recent update to xcode 5.1:
http://bruteforce.gr/installing-mitmproxy-os-x-maverics-bypassing-clang-error-unknown-argument.html
http://forums.getpebble.com/discussion/11862/installation-error-perhaps-due-to-xcode-5-1
However, I have tried the current work-around and I still get the error:
This is what I have tried:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future sudo pip install mysql-python
This is the error:
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 -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.9-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing -arch x86_64
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
Anyone had the same issue and know of a workaround that works in your virtual env?
I wrote the post on your first link. I am not 100% percent sure but I think the problem lies with the use of sudo. The variable is set under your user, while the pip command is elevated to root privileges, i.e. is executed under another user. Try to do the above logged in as root user from the start, without sudoing.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
The problem with installing PIL using virtualenv or buildout
how to install PIL on mac os x 10.7.2 Lion
I'm trying to install the latest version of PIL (1.1.7) on Mac OS X Lion (10.7.4). I generally just use PIP and the following command:
sudo pip install package_name
However, I'm getting an error message for PIL, as it is refusing to cooperate with me.
Here is what I received:
mac-cordreys-macbook-pro:~ maccordrey$ sudo pip install PIL
Password:
Downloading/unpacking PIL
Downloading PIL-1.1.7.tar.gz (506Kb): 506Kb downloaded
Running setup.py egg_info for package PIL
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
Installing collected packages: PIL
Running setup.py install for PIL
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
llvm-gcc-4.2 -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 -arch i386 -arch x86_64 -pipe -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.7-intel-2.7/_imaging.o
unable to execute llvm-gcc-4.2: No such file or directory
error: command 'llvm-gcc-4.2' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools;__file__='/Users/maccordrey/build/PIL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-KmYgGQ-record/install-record.txt:
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
running install
running build
running build_py
creating build
creating build/lib.macosx-10.7-intel-2.7
copying PIL/__init__.py -> build/lib.macosx-10.7-intel-2.7
(To save space I've redacted this middle portion, but it's just more copying of package scripts.)
copying PIL/XVThumbImagePlugin.py -> build/lib.macosx-10.7-intel-2.7
running build_ext
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
creating build/temp.macosx-10.7-intel-2.7
creating build/temp.macosx-10.7-intel-2.7/libImaging
llvm-gcc-4.2 -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 -arch i386 -arch x86_64 -pipe -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.7-intel-2.7/_imaging.o
unable to execute llvm-gcc-4.2: No such file or directory
error: command 'llvm-gcc-4.2' failed with exit status 1
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/Users/maccordrey/build/PIL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-KmYgGQ-record/install-record.txt failed with error code 1 in /Users/maccordrey/build/PIL
Storing complete log in /Users/maccordrey/Library/Logs/pip.log
Any advice would be appreciated! Thank you!
I should also note that when trying to install Pillow as an alternative I received the exact same error message.