xlwings module installation issue - python

I tried the command:
python3 -m pip install xlwings
But I got the following (long) error. The error is too long so i put only the end. Installation of other packages with the same command are working. Do somebody know how to solve that please?
...
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=567 -DPSUTIL_OSX=1 -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c psutil/_psutil_common.c -o build/temp.macosx-10.9-x86_64-3.7/psutil/_psutil_common.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=567 -DPSUTIL_OSX=1 -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c psutil/_psutil_posix.c -o build/temp.macosx-10.9-x86_64-3.7/psutil/_psutil_posix.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=567 -DPSUTIL_OSX=1 -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c psutil/_psutil_osx.c -o build/temp.macosx-10.9-x86_64-3.7/psutil/_psutil_osx.o
In file included from psutil/_psutil_osx.c:36:
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43:
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:
/usr/local/include/Block.h:16:3: error: Never include this file directly. Use <lzma.h> instead.
# error Never include this file directly. Use <lzma.h> instead.
^
/usr/local/include/Block.h:93:2: error: unknown type name 'lzma_check'
lzma_check check;
^
...
lzma_bool reserved_bool2;
^
/usr/local/include/Block.h:264:2: error: unknown type name 'lzma_bool'
lzma_bool reserved_bool3;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for psutil
Running setup.py clean for psutil
Failed to build psutil
Installing collected packages: psutil, xlwings
Running setup.py install for psutil ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/cy/jtv0bpc11vsbbmfhjzz5zlz00000gr/T/pip-install-3i68cw09/psutil/setup.py'"'"'; __file__='"'"'/private/var/folders/cy/jtv0bpc11vsbbmfhjzz5zlz00000gr/T/pip-install-3i68cw09/psutil/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/cy/jtv0bpc11vsbbmfhjzz5zlz00000gr/T/pip-record-k62qhrl9/install-record.txt --single-version-externally-managed --compile
cwd: /private/var/folders/cy/jtv0bpc11vsbbmfhjzz5zlz00000gr/T/pip-install-3i68cw09/psutil/
Complete output (106 lines):
...
creating build/temp.macosx-10.9-x86_64-3.7/psutil/arch
creating build/temp.macosx-10.9-x86_64-3.7/psutil/arch/osx
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=567 -DPSUTIL_OSX=1 -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c psutil/_psutil_common.c -o build/temp.macosx-10.9-x86_64-3.7/psutil/_psutil_common.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=567 -DPSUTIL_OSX=1 -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c psutil/_psutil_posix.c -o build/temp.macosx-10.9-x86_64-3.7/psutil/_psutil_posix.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=567 -DPSUTIL_OSX=1 -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c psutil/_psutil_osx.c -o build/temp.macosx-10.9-x86_64-3.7/psutil/_psutil_osx.o
In file included from psutil/_psutil_osx.c:36:
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43:
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:
/usr/local/include/Block.h:16:3: error: Never include this file directly. Use <lzma.h> instead.
# error Never include this file directly. Use <lzma.h> instead.
^
/usr/local/include/Block.h:93:2: error: unknown type name 'lzma_check'
lzma_check check;
...
lzma_bool ignore_check;
^
/usr/local/include/Block.h:263:2: error: unknown type name 'lzma_bool'
lzma_bool reserved_bool2;
^
/usr/local/include/Block.h:264:2: error: unknown type name 'lzma_bool'
lzma_bool reserved_bool3;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/cy/jtv0bpc11vsbbmfhjzz5zlz00000gr/T/pip-install-3i68cw09/psutil/setup.py'"'"'; __file__='"'"'/private/var/folders/cy/jtv0bpc11vsbbmfhjzz5zlz00000gr/T/pip-install-3i68cw09/psutil/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/cy/jtv0bpc11vsbbmfhjzz5zlz00000gr/T/pip-record-k62qhrl9/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
EDIT: I have added part of the error as it could be useful.
I had to cut the error as it is not accepted because too long.

Related

"libusb.h: No such file or directory" from gcc compiling Python module

I'm getting this kind of error and I was unable to find the right answer on the internet.
I tried to update the controller software of my NZXT Kraken water pump and it won't start now.
https://gitlab.com/leinardi/gkraken
I would be really thankful for some guidance.
Here is my full error:
Running setup.py install for hidapi ... error
ERROR: Complete output from command /usr/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-7z0im1kt/hidapi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ox5wudk7/install-record.txt --single-version-externally-managed --compile:
ERROR: running install
running build
running build_ext
cythoning hid.pyx to hid.c
/usr/local/lib64/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-7z0im1kt/hidapi/hid.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
cythoning hidraw.pyx to hidraw.c
/usr/local/lib64/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-7z0im1kt/hidapi/hidraw.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
building 'hid' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/hidapi
creating build/temp.linux-x86_64-3.7/hidapi/libusb
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/usr/include/python3.7m -c hid.c -o build/temp.linux-x86_64-3.7/hid.o
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/usr/include/python3.7m -c hidapi/libusb/hid.c -o build/temp.linux-x86_64-3.7/hidapi/libusb/hid.o
hidapi/libusb/hid.c:26: warning: "_GNU_SOURCE" redefined
26 | #define _GNU_SOURCE /* needed for wcsdup() before glibc 2.10 */
|
<command-line>: note: this is the location of the previous definition
hidapi/libusb/hid.c:47:10: fatal error: libusb.h: No such file or directory
47 | #include <libusb.h>
| ^~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command "/usr/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-7z0im1kt/hidapi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ox5wudk7/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-7z0im1kt/hidapi/ ```
This was solved by running:
sudo dnf install libusbx-devel libudev-devel

Missing numpy header while installing sklearn on Alpine Linux

I'm trying to install sklearn on top of a Docker image (FROM astronomerinc/ap-airflow:master-1.10.5-onbuild). Environment coming with the source image:
Alpine Linux v3.10 (kernel 4.9.93-linuxkit-aufs)
Python 3.7.3
numpy==1.17.2
pandas==0.25.1
pandas-gbq==0.11.0
...
I had scipy==1.3.1 in my requirements.txt and had no issues installing it with pip, however when I added scikit-learn to requirements.txt and rebuilt again, I got this error saying a numpy header is missing:
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/sklearn
creating build/temp.linux-x86_64-3.7/sklearn/svm
creating build/temp.linux-x86_64-3.7/sklearn/svm/src
creating build/temp.linux-x86_64-3.7/sklearn/svm/src/libsvm
compile options: '-I/usr/lib/python3.7/site-packages/numpy/core/include -c'
g++: sklearn/svm/src/libsvm/libsvm_template.cpp
ar: adding 1 object files to build/temp.linux-x86_64-3.7/liblibsvm-skl.a
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
resetting extension 'sklearn.svm.liblinear' language from 'c' to 'c++'.
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'sklearn.__check_build._check_build' extension
compiling C sources
C compiler: gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC
creating build/temp.linux-x86_64-3.7/sklearn/__check_build
compile options: '-I/usr/lib/python3.7/site-packages/numpy/core/include -I/usr/lib/python3.7/site-packages/numpy/core/include -I/usr/include/python3.7m -c'
gcc: sklearn/__check_build/_check_build.c
gcc -shared -Wl,--as-needed -Wl,--as-needed build/temp.linux-x86_64-3.7/sklearn/__check_build/_check_build.o -L/usr/lib -Lbuild/temp.linux-x86_64-3.7 -lpython3.7m -o build/lib.linux-x86_64-3.7/sklearn/__check_build/_check_build.cpython-37m-x86_64-linux-gnu.so
building 'sklearn.cluster._dbscan_inner' extension
compiling C++ sources
C compiler: g++ -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC
creating build/temp.linux-x86_64-3.7/sklearn/cluster
compile options: '-I/usr/lib/python3.7/site-packages/numpy/core/include -I/usr/lib/python3.7/site-packages/numpy/core/include -I/usr/include/python3.7m -c'
g++: sklearn/cluster/_dbscan_inner.cpp
sklearn/cluster/_dbscan_inner.cpp:652:10: fatal error: numpy/arrayobject.h: No such file or directory
#include "numpy/arrayobject.h"
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: Command "g++ -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/lib/python3.7/site-packages/numpy/core/include -I/usr/lib/python3.7/site-packages/numpy/core/include -I/usr/include/python3.7m -c sklearn/cluster/_dbscan_inner.cpp -o build/temp.linux-x86_64-3.7/sklearn/cluster/_dbscan_inner.o -MMD -MF build/temp.linux-x86_64-3.7/sklearn/cluster/_dbscan_inner.o.d" failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o8ktwf40/scikit-learn/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o8ktwf40/scikit-learn/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-p6ejlhi_/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
WARNING: You are using pip version 19.2.1, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The command '/bin/sh -c pip install --no-cache-dir -q -r requirements.txt' returned a non-zero code: 1
Several things I've tried:
upgrading pip
specifying an older version of scikit-learn
"explicitly" installing py3-numpy
None of them worked unfortunately. This post recommends setting the path manually but that just wasn't the answer I was looking for.
Insights? Any help is appreciated!
I suggest you to install py-numpy-dev in your Dockerfile:
RUN apk add py-numpy-dev

Installing Python's new regex module not working

I am trying to install an alternative regular expression module to replace re but am having difficulty installing the module. I have already visited this stack overflow question and when following Pavan's instructions, Terminal (I'm running OSX El Capitan) produces the following output:
Edit: To clarify, this output was produced when the command pip install regex was issued.
Collecting regex
Using cached regex-2016.04.15.tar.gz
Installing collected packages: regex
Running setup.py install for regex ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/z6/vncx8j5977xd96vnrtj41xt40000gn/T/pip-build-AwqJ7Z/regex/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/z6/vncx8j5977xd96vnrtj41xt40000gn/T/pip-uG2qOh-record/install-record.txt --single-version-externally-managed --compile:
/Library/Python/2.7/site-packages/setuptools-20.9.0-py2.7.egg/setuptools/dist.py:285: UserWarning: Normalizing '2016.04.15' to '2016.4.15'
running install
running build
running build_py
creating build
creating build/lib.macosx-10.11-intel-2.7
copying Python2/regex.py -> build/lib.macosx-10.11-intel-2.7
copying Python2/_regex_core.py -> build/lib.macosx-10.11-intel-2.7
copying Python2/test_regex.py -> build/lib.macosx-10.11-intel-2.7
running build_ext
building '_regex' extension
creating build/temp.macosx-10.11-intel-2.7
creating build/temp.macosx-10.11-intel-2.7/Python2
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -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 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c Python2/_regex.c -o build/temp.macosx-10.11-intel-2.7/Python2/_regex.o
Python2/_regex.c:16531:77: warning: '&&' within '||' [-Wlogical-op-parentheses]
if (state->total_errors < error_limit || i == 0 &&
~~ ~~~~~~~^~
Python2/_regex.c:16531:77: note: place parentheses around the '&&' expression to silence this warning
if (state->total_errors < error_limit || i == 0 &&
^
Python2/_regex.c:16534:38: warning: variable 'better' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
else if (state->total_errors == error_limit)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Python2/_regex.c:16542:33: note: uninitialized use occurs here
if (better) {
^~~~~~
Python2/_regex.c:16534:34: note: remove the 'if' if its condition is always true
else if (state->total_errors == error_limit)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Python2/_regex.c:16529:40: note: initialize the variable 'better' to silence this warning
BOOL better;
^
= '\0'
Python2/_regex.c:18564:28: warning: unused function 'match_get_group_dict' [-Wunused-function]
Py_LOCAL_INLINE(PyObject*) match_get_group_dict(MatchObject* self) {
^
3 warnings generated.
Python2/_regex.c:16531:77: warning: '&&' within '||' [-Wlogical-op-parentheses]
if (state->total_errors < error_limit || i == 0 &&
~~ ~~~~~~~^~
Python2/_regex.c:16531:77: note: place parentheses around the '&&' expression to silence this warning
if (state->total_errors < error_limit || i == 0 &&
^
Python2/_regex.c:16534:38: warning: variable 'better' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
else if (state->total_errors == error_limit)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Python2/_regex.c:16542:33: note: uninitialized use occurs here
if (better) {
^~~~~~
Python2/_regex.c:16534:34: note: remove the 'if' if its condition is always true
else if (state->total_errors == error_limit)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Python2/_regex.c:16529:40: note: initialize the variable 'better' to silence this warning
BOOL better;
^
= '\0'
Python2/_regex.c:18564:28: warning: unused function 'match_get_group_dict' [-Wunused-function]
Py_LOCAL_INLINE(PyObject*) match_get_group_dict(MatchObject* self) {
^
3 warnings generated.
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -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 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c Python2/_regex_unicode.c -o build/temp.macosx-10.11-intel-2.7/Python2/_regex_unicode.o
cc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -Wl,-F. build/temp.macosx-10.11-intel-2.7/Python2/_regex.o build/temp.macosx-10.11-intel-2.7/Python2/_regex_unicode.o -o build/lib.macosx-10.11-intel-2.7/_regex.so
running install_lib
copying build/lib.macosx-10.11-intel-2.7/_regex.so -> /Library/Python/2.7/site-packages
error: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/_regex.so'
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/z6/vncx8j5977xd96vnrtj41xt40000gn/T/pip-build-AwqJ7Z/regex/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/z6/vncx8j5977xd96vnrtj41xt40000gn/T/pip-uG2qOh-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/z6/vncx8j5977xd96vnrtj41xt40000gn/T/pip-build-AwqJ7Z/regex/
Looks like a C compiler got grumpy and threw a tantrum, any help is greatly appreciated.
This is not a compile problem. You are executing pip as user with not enough privileges:
Permission denied: '/Library/Python/2.7/site-packages/_regex.so'
Run as root:
$ sudo pip install regex

Installing Pillow, getting -Wunused-command-line-argument-hard-error-in-future

I cannot get pillow installed.
(env)noah:cupalensic2 broinjc$ which cc
/usr/bin/cc
(env)noah:cupalensic2 broinjc$ cc --version
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
I ran pip install mezzanine and when it got to satisfying pillow it screwed up...
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 -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Versions/8.5/Headers -I/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/opt/X11/include/freetype2 -I/Users/broinjc/cupalensic2/env/build/pillow/libImaging -I/Users/broinjc/cupalensic2/env/include -I/usr/local/include -I/opt/X11/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.9-intel-2.7/_imaging.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 /Users/broinjc/cupalensic2/env/bin/python -c "import setuptools;__file__='/Users/broinjc/cupalensic2/env/build/pillow/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/lg/y_cwnrnd3rn4x_j1sbd1mg_h0000gn/T/pip-o0HQHe-record/install-record.txt --single-version-externally-managed --install-headers /Users/broinjc/cupalensic2/env/include/site/python2.7 failed with error code 1 in /Users/broinjc/cupalensic2/env/build/pillow
Storing complete log in /Users/broinjc/.pip/pip.log
Any idea what might be going on here?
This is a known issue with OSX and recent Xcode upgrade.
Instructions how to avoid the issue are here:
Ansible Installation -clang: error: unknown argument: '-mno-fused-madd'
This should do the trick::
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install Pillow

Errors while installing matplotlib on OS X 10.8

I am trying to install matplotlib on my machine with OS X 10.8 and XCode 5.0.2. I get these weird errors of which I am not able to make sense. I used pip install matplotlib to install the package, but then it returns the following errors at the end. I am clueless on what to do. Please help me proceed. I tried to install scipy through the same process and the same error stream prevails.
building 'rootfind' library
compiling C sources
C compiler: clang -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 -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe
creating build/temp.macosx-10.8-intel-2.7/scipy/optimize/Zeros
compile options: '-I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -c'
clang: scipy/optimize/Zeros/bisect.c
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
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 "clang -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 -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -c scipy/optimize/Zeros/bisect.c -o build/temp.macosx-10.8-intel-2.7/scipy/optimize/Zeros/bisect.o" failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/v3/xf03tznj5hn9mj7j_4jbkvw40000gn/T/pip_build_Siva/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/v3/xf03tznj5hn9mj7j_4jbkvw40000gn/T/pip-u0HK_Y-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/v3/xf03tznj5hn9mj7j_4jbkvw40000gn/T/pip_build_Siva/scipy
After this I set the ARCHFLAGS variable to the following
export ARCHFLAGS='-Wno-error=unused-command-line-argument-hard-error-in-future'
Although the installatoion proceeds a bit further, I get an error stream at a different point now.
running build_ext
building 'matplotlib.ft2font' extension
creating build/temp.macosx-10.8-intel-2.7
creating build/temp.macosx-10.8-intel-2.7/src
creating build/temp.macosx-10.8-intel-2.7/CXX
clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -I/usr/local/include -I/usr/include -I. -I/usr/local/Cellar/freetype/2.5.3_1/include/freetype2 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/ft2font.cpp -o build/temp.macosx-10.8-intel-2.7/src/ft2font.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 'clang' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/matplotlib/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ZU81yE-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/matplotlib
That's a common problem, the last macos updates make clang generate errors instead of warnings for unknown compiler options. As a temporary workaround you could set ARCHFLAGS environment variable, before running pip:
export ARCHFLAGS='-Wno-error=unused-command-line-argument-hard-error-in-future'
I prefer to use Canopy as a python environment on OS X since it is usually harder to install python packages on a Mac.
You can get it here : https://www.enthought.com/downloads/.
MatPlotLib is installed by default, and many more packages are easier to install after installing Canopy.

Categories