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
Related
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.
I'm configuring a virtualenv to work with a legacy webservices application developed on python using flask microframework and PostgreSQLdatabase, this application use PyGreSQL 5.0.3 as a dependency to connect with the database.
I have installed the PostgreSQL 9.6.1, i installed it using:
brew install postgresql
I have installed and working with Python 2.7
When i run the
pip install -r requirements.txt
i'm gettin this error message:
Running setup.py install for PyGreSQL ... error
Complete output from command /Users/user/Development/Projects/flask/ws/myenv/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/t1/x7lrbmyd3lq0k8ngknwg1zx00000gn/T/pip-build-KjQgiU/PyGreSQL/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/t1/x7lrbmyd3lq0k8ngknwg1zx00000gn/T/pip-3lBp1N-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/user/Development/Projects/flask/ws/myenv/include/site/python2.7/PyGreSQL:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.12-intel-2.7
copying pg.py -> build/lib.macosx-10.12-intel-2.7
copying pgdb.py -> build/lib.macosx-10.12-intel-2.7
running build_ext
building '_pg' extension
creating build/temp.macosx-10.12-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 -DPYGRESQL_VERSION=5.0.3 -DDIRECT_ACCESS -DLARGE_OBJECTS -DDEFAULT_VARS -DESCAPING_FUNCS -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/Cellar/postgresql/9.6.1/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pgmodule.c -o build/temp.macosx-10.12-intel-2.7/pgmodule.o -O2 -funsigned-char -Wall -Werror
pgmodule.c:4143:9: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
num = PyInt_AsLong(param);
~ ^~~~~~~~~~~~~~~~~~~
pgmodule.c:4448:12: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
pgport = PyInt_AsLong(pg_default_port);
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
error: command 'cc' failed with exit status 1
----------------------------------------
As you can see, this error is derived from compile and build the package, but I have the postgresql library installed, which I see as the common problem in other cases. On the other hand I have installed the command line tools of mac, i changed my compiler from cc to gcc and i'm having the same error
Any idea how to solve it, thank you in advance
I wasn't able to install any version of this package normally. It's probably a problem with the package.
Workaround: If you turn off warn-as-error, it should compile fine.
export CFLAGS="-Wno-error"
pip install PyGreSQL
I'm using MacBook and Operating System is MacOS Sierra.
I use this command to install autopy:
sudo pip install autopy
But i get this error:
Collecting autopy
Downloading autopy-0.51.tar.gz (74kB)
100% |████████████████████████████████| 81kB 256kB/s
Installing collected packages: autopy
Running setup.py install for autopy ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-jSobWR/autopy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-lxk785-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.12-intel-2.7
creating build/lib.macosx-10.12-intel-2.7/autopy
copying autopy/__init__.py -> build/lib.macosx-10.12-intel-2.7/autopy
running build_ext
building 'color' extension
creating build/temp.macosx-10.12-intel-2.7
creating build/temp.macosx-10.12-intel-2.7/src
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 -DNDEBUG=1 -DMM_LITTLE_ENDIAN -DIS_MACOSX -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/autopy-color-module.c -o build/temp.macosx-10.12-intel-2.7/src/autopy-color-module.o -Wall -Wparentheses -Winline -Wbad-function-cast -Wdisabled-optimization -Wshadow
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 -DNDEBUG=1 -DMM_LITTLE_ENDIAN -DIS_MACOSX -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MMBitmap.c -o build/temp.macosx-10.12-intel-2.7/src/MMBitmap.o -Wall -Wparentheses -Winline -Wbad-function-cast -Wdisabled-optimization -Wshadow
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.12-intel-2.7/src/autopy-color-module.o build/temp.macosx-10.12-intel-2.7/src/MMBitmap.o -o build/lib.macosx-10.12-intel-2.7/autopy/color.so
building 'screen' 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 -DNDEBUG=1 -DMM_LITTLE_ENDIAN -DIS_MACOSX -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/autopy-screen-module.c -o build/temp.macosx-10.12-intel-2.7/src/autopy-screen-module.o -Wall -Wparentheses -Winline -Wbad-function-cast -Wdisabled-optimization -Wshadow
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 -DNDEBUG=1 -DMM_LITTLE_ENDIAN -DIS_MACOSX -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/screen.c -o build/temp.macosx-10.12-intel-2.7/src/screen.o -Wall -Wparentheses -Winline -Wbad-function-cast -Wdisabled-optimization -Wshadow
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 -DNDEBUG=1 -DMM_LITTLE_ENDIAN -DIS_MACOSX -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/screengrab.c -o build/temp.macosx-10.12-intel-2.7/src/screengrab.o -Wall -Wparentheses -Winline -Wbad-function-cast -Wdisabled-optimization -Wshadow
src/screengrab.c:48:26: warning: implicit declaration of function 'CGDisplayBitsPerPixel' is invalid in C99 [-Wimplicit-function-declaration]
bitsPerPixel = (uint8_t)CGDisplayBitsPerPixel(displayID);
^
src/screengrab.c:174:15: warning: 'kCGLPFAFullScreen' is deprecated: first deprecated in macOS 10.6 [-Wdeprecated-declarations]
attribs[0] = kCGLPFAFullScreen;
^
/System/Library/Frameworks/OpenGL.framework/Headers/CGLTypes.h:98:2: note: 'kCGLPFAFullScreen' has been explicitly marked deprecated here
kCGLPFAFullScreen OPENGL_ENUM_DEPRECATED(10_0, 10_6) = 54,
^
src/screengrab.c:191:2: warning: 'CGLSetFullScreen' is deprecated: first deprecated in macOS 10.6 [-Wdeprecated-declarations]
CGLSetFullScreen(glContext);
^
/System/Library/Frameworks/OpenGL.framework/Headers/OpenGL.h:73:17: note: 'CGLSetFullScreen' has been explicitly marked deprecated here
extern CGLError CGLSetFullScreen(CGLContextObj ctx) OPENGL_DEPRECATED(10_0, 10_6);
^
src/screengrab.c:194:2: warning: implicit declaration of function 'glReadBuffer' is invalid in C99 [-Wimplicit-function-declaration]
glReadBuffer(GL_FRONT);
^
src/screengrab.c:194:15: error: use of undeclared identifier 'GL_FRONT'
glReadBuffer(GL_FRONT);
^
src/screengrab.c:197:2: warning: implicit declaration of function 'glFinish' is invalid in C99 [-Wimplicit-function-declaration]
glFinish();
^
src/screengrab.c:199:6: warning: implicit declaration of function 'glGetError' is invalid in C99 [-Wimplicit-function-declaration]
if (glGetError() != GL_NO_ERROR) return NULL;
^
src/screengrab.c:199:22: error: use of undeclared identifier 'GL_NO_ERROR'
if (glGetError() != GL_NO_ERROR) return NULL;
^
src/screengrab.c:207:2: warning: implicit declaration of function 'glPopClientAttrib' is invalid in C99 [-Wimplicit-function-declaration]
glPopClientAttrib(); /* Clear attributes previously set. */
^
src/screengrab.c:223:2: warning: implicit declaration of function 'glPushClientAttrib' is invalid in C99 [-Wimplicit-function-declaration]
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
^
src/screengrab.c:223:21: error: use of undeclared identifier 'GL_CLIENT_PIXEL_STORE_BIT'
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
^
src/screengrab.c:225:2: warning: implicit declaration of function 'glPixelStorei' is invalid in C99 [-Wimplicit-function-declaration]
glPixelStorei(GL_PACK_ALIGNMENT, BYTE_ALIGN); /* Force alignment. */
^
src/screengrab.c:225:16: error: use of undeclared identifier 'GL_PACK_ALIGNMENT'
glPixelStorei(GL_PACK_ALIGNMENT, BYTE_ALIGN); /* Force alignment. */
^
src/screengrab.c:226:16: error: use of undeclared identifier 'GL_PACK_ROW_LENGTH'
glPixelStorei(GL_PACK_ROW_LENGTH, 0);
^
src/screengrab.c:227:16: error: use of undeclared identifier 'GL_PACK_SKIP_ROWS'
glPixelStorei(GL_PACK_SKIP_ROWS, 0);
^
src/screengrab.c:228:16: error: use of undeclared identifier 'GL_PACK_SKIP_PIXELS'
glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
^
src/screengrab.c:235:2: warning: implicit declaration of function 'glReadPixels' is invalid in C99 [-Wimplicit-function-declaration]
glReadPixels(x, y, width, height,
^
src/screengrab.c:236:30: error: use of undeclared identifier 'GL_BGRA'
MMRGB_IS_BGR ? GL_BGRA : GL_RGBA,
^
src/screengrab.c:240:15: error: use of undeclared identifier 'GL_UNSIGNED_INT_8_8_8_8_REV'
GL_UNSIGNED_INT_8_8_8_8_REV, /* Native format */
^
10 warnings and 9 errors generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-jSobWR/autopy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-lxk785-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-jSobWR/autopy/
Why am i getting this error?
There is a known issue that for some reason wasn't fixed.
Issue: https://github.com/msanders/autopy/issues/75
It contains following workaround (commands to type in console):
brew install libpng
CFLAGS="-Wno-return-type" pip install git+https://github.com/potpath/autopy.git
Generally, it works quite easily but if it doesn't then it's a bit tricky and you need to take run commands on your terminal.
First, check if a binary wheel is available for your machine by running:
$ pip install -U autopy
If that fails, install rustup and then run:
$ rustup default nightly-2019-10-05
$ pip install -U setuptools-rust
$ pip install -U autopy
sometimes $ rustup default nightly-2019-10-05 doesn't work due to unavailability of all packages, run rustup install nightly 2019-10-05 --force. But you have make sure that the rustup installation is properly done as it requires the installation of [BuildTools][2] as well
You must Use 3.8 to install autopy. If you are not sure, type in your terminal:
python --version
None version of python except 3.8 can install autopy.
See other versions of autopy https://pypi.org/project/autopy/ .
Thanks.
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
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.