Pip install and python headers - python

I'm trying to install the celerite package, but I’m struggling to get it pip installed on my Apple M1 Mac. The Terminal output is below. Is this an M1 issue or a Python-C headers issue?
~ > pip install celerite
WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/9617>
distutils: /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/UNKNOWN
sysconfig: /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9
WARNING: Additional context:
user = False
home = None
root = None
prefix = None
Collecting celerite
Using cached celerite-0.4.0.tar.gz (1.3 MB)
Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from celerite) (1.19.5)
Requirement already satisfied: pybind11 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from celerite) (2.6.2)
Using legacy 'setup.py install' for celerite, since package 'wheel' is not installed.
Installing collected packages: celerite
Running setup.py install for celerite ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/pip-install-ejzry3ds/celerite_7d3f74933971475894ddbc9a37f5d2d3/setup.py'"'"'; __file__='"'"'/private/var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/pip-install-ejzry3ds/celerite_7d3f74933971475894ddbc9a37f5d2d3/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/pip-record-eyjraeap/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/celerite
cwd: /private/var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/pip-install-ejzry3ds/celerite_7d3f74933971475894ddbc9a37f5d2d3/
Complete output (142 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.9
creating build/lib.macosx-10.9-x86_64-3.9/celerite
copying celerite/terms.py -> build/lib.macosx-10.9-x86_64-3.9/celerite
copying celerite/build.py -> build/lib.macosx-10.9-x86_64-3.9/celerite
copying celerite/timer.py -> build/lib.macosx-10.9-x86_64-3.9/celerite
copying celerite/__init__.py -> build/lib.macosx-10.9-x86_64-3.9/celerite
copying celerite/celerite.py -> build/lib.macosx-10.9-x86_64-3.9/celerite
copying celerite/plot_setup.py -> build/lib.macosx-10.9-x86_64-3.9/celerite
copying celerite/modeling.py -> build/lib.macosx-10.9-x86_64-3.9/celerite
running egg_info
writing celerite.egg-info/PKG-INFO
writing dependency_links to celerite.egg-info/dependency_links.txt
writing requirements to celerite.egg-info/requires.txt
writing top-level names to celerite.egg-info/top_level.txt
reading manifest file 'celerite.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'celerite.egg-info/SOURCES.txt'
copying celerite/solver.cpp -> build/lib.macosx-10.9-x86_64-3.9/celerite
running build_ext
testing C++14/C++11 support
creating var
creating var/folders
creating var/folders/y9
creating var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp
creating var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmp6bm3jgjr.cpp -o var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmp6bm3jgjr.o -std=c++14
testing compiler flags
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpw_0z5jvh.cpp -o var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpw_0z5jvh.o -stdlib=libc++
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpzofp_v4s.cpp -o var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpzofp_v4s.o -fvisibility=hidden
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmp7n02kzyj.cpp -o var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmp7n02kzyj.o -Wno-unused-function
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpaax51kgm.cpp -o var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpaax51kgm.o -Wno-uninitialized
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmp9nw9zr5w.cpp -o var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmp9nw9zr5w.o -Wno-unused-local-typedefs
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmp5rqw4hd2.cpp -o var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmp5rqw4hd2.o -funroll-loops
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpzv7s8yxb.cpp -o var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpzv7s8yxb.o -march=native
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpbedvthn6.cpp -o var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/tmpbedvthn6.o -mmacosx-version-min=10.9
building 'celerite.solver' extension
creating build/temp.macosx-10.9-x86_64-3.9
creating build/temp.macosx-10.9-x86_64-3.9/celerite
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -Icpp/include -Icpp/lib/eigen_3.3.3 -I/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include -I/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c celerite/solver.cpp -o build/temp.macosx-10.9-x86_64-3.9/celerite/solver.o -DNODEBUG -DVERSION_INFO="0.4.0" -std=c++14 -stdlib=libc++ -fvisibility=hidden -Wno-unused-function -Wno-uninitialized -Wno-unused-local-typedefs -funroll-loops -march=native -mmacosx-version-min=10.9
In file included from celerite/solver.cpp:1:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/pybind11.h:45:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/attr.h:13:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/cast.h:13:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/pytypes.h:12:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/detail/common.h:124:
/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/Python.h:14:2: error: "Something's broken. UCHAR_MAX should be defined in limits.h."
#error "Something's broken. UCHAR_MAX should be defined in limits.h."
^
/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/Python.h:18:2: error: "Python's source code assumes C's unsigned char is an 8-bit type."
#error "Python's source code assumes C's unsigned char is an 8-bit type."
^
/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/Python.h:27:5: error: "Python.h requires that stdio.h define NULL."
# error "Python.h requires that stdio.h define NULL."
^
In file included from celerite/solver.cpp:1:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/pybind11.h:45:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/attr.h:13:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/cast.h:13:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/pytypes.h:12:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/detail/common.h:124:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/Python.h:30:
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:73:64: error: use of undeclared identifier 'strchr'
char* __libcpp_strchr(const char* __s, int __c) {return (char*)strchr(__s, __c);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:80:75: error: use of undeclared identifier 'strpbrk'
char* __libcpp_strpbrk(const char* __s1, const char* __s2) {return (char*)strpbrk(__s1, __s2);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:87:65: error: use of undeclared identifier 'strrchr'; did you mean 'strchr'?
char* __libcpp_strrchr(const char* __s, int __c) {return (char*)strrchr(__s, __c);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:75:13: note: 'strchr' declared here
const char* strchr(const char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:94:49: error: unknown type name 'size_t'
void* __libcpp_memchr(const void* __s, int __c, size_t __n) {return (void*)memchr(__s, __c, __n);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:96:46: error: unknown type name 'size_t'
const void* memchr(const void* __s, int __c, size_t __n) {return __libcpp_memchr(__s, __c, __n);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:98:46: error: unknown type name 'size_t'
void* memchr( void* __s, int __c, size_t __n) {return __libcpp_memchr(__s, __c, __n);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:101:74: error: use of undeclared identifier 'strstr'; did you mean 'strchr'?
char* __libcpp_strstr(const char* __s1, const char* __s2) {return (char*)strstr(__s1, __s2);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:77:13: note: 'strchr' declared here
char* strchr( char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:101:74: error: no matching function for call to 'strchr'
char* __libcpp_strstr(const char* __s1, const char* __s2) {return (char*)strstr(__s1, __s2);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:77:13: note: candidate disabled: <no message provided>
char* strchr( char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:101:81: error: cannot initialize a parameter of type 'char *' with an lvalue of type 'const char *'
char* __libcpp_strstr(const char* __s1, const char* __s2) {return (char*)strstr(__s1, __s2);}
^~~~
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/string.h:77:32: note: passing argument to parameter '__s' here
char* strchr( char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
In file included from celerite/solver.cpp:1:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/pybind11.h:45:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/attr.h:13:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/cast.h:13:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/pytypes.h:12:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pybind11/include/pybind11/detail/common.h:124:
In file included from /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/Python.h:34:
In file included from /Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/stdlib.h:100:
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/math.h:769:12: error: no member named 'labs' in the global namespace; did you mean 'abs'?
return ::labs(__x);
~~^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/math.h:768:39: note: 'abs' declared here
inline _LIBCPP_INLINE_VISIBILITY long abs(long __x) _NOEXCEPT {
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/math.h:773:12: error: no member named 'llabs' in the global namespace
return ::llabs(__x);
~~^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/math.h:781:12: error: no member named 'fabsf' in the global namespace
return ::fabsf(__lcpp_x);
~~^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/math.h:785:12: error: no member named 'fabs' in the global namespace; did you mean 'abs'?
return ::fabs(__lcpp_x);
~~^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/math.h:768:39: note: 'abs' declared here
inline _LIBCPP_INLINE_VISIBILITY long abs(long __x) _NOEXCEPT {
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/math.h:790:12: error: no member named 'fabsl' in the global namespace
return ::fabsl(__lcpp_x);
~~^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/math.h:804:34: error: unknown type name 'ldiv_t'
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {
^
/Library/Developer/Toolchains/swift-5.3.3-RELEASE.xctoolchain/usr/bin/../include/c++/v1/math.h:805:12: error: no member named 'ldiv' in the global namespace
return ::ldiv(__x, __y);
~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/pip-install-ejzry3ds/celerite_7d3f74933971475894ddbc9a37f5d2d3/setup.py'"'"'; __file__='"'"'/private/var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/pip-install-ejzry3ds/celerite_7d3f74933971475894ddbc9a37f5d2d3/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/y9/twfc9zz104bbyg90rrh3t23h0000gp/T/pip-record-eyjraeap/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/celerite Check the logs for full command output.
'''

Related

Reportlab installation failed after upgrading to Macos Big Sur

I'm trying to reinstall my virtual env after upgrade to MacOS Big Sur.
But error appears:
4 warnings generated.
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Qunused-arguments -Qunused-arguments -DRENDERPM_FT -DLIBART_COMPILATION -DLIBART_VERSION=2.3.21 -Isrc/rl_addons/renderPM -Isrc/rl_addons/renderPM/libart_lgpl -Isrc/rl_addons/renderPM/gt1 -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/sqlite/include -I/Users/zulfugar/PycharmProjects/AppForm/.venv/include -I/usr/local/Cellar/python#3.8/3.8.6_1/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/rl_addons/renderPM/gt1/gt1-parset1.c -o build/temp.macosx-11.0-x86_64-3.8/src/rl_addons/renderPM/gt1/gt1-parset1.o
src/rl_addons/renderPM/gt1/gt1-parset1.c:604:28: warning: for loop has empty body [-Wempty-body]
for (i = 0; i < size; i++);
^
src/rl_addons/renderPM/gt1/gt1-parset1.c:604:28: note: put the semicolon on a separate line to silence this warning
src/rl_addons/renderPM/gt1/gt1-parset1.c:1907:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
for (i = 0; i < sizeof(internal_procs) / sizeof(InternalGt1ProcListing); i++)
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/rl_addons/renderPM/gt1/gt1-parset1.c:710:1: warning: function 'print_value_deep' is not needed and will not be emitted [-Wunneeded-internal-declaration]
print_value_deep (Gt1PSContext *psc, Gt1Value *val, int nest)
^
3 warnings generated.
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Qunused-arguments -Qunused-arguments -DRENDERPM_FT -DLIBART_COMPILATION -DLIBART_VERSION=2.3.21 -Isrc/rl_addons/renderPM -Isrc/rl_addons/renderPM/libart_lgpl -Isrc/rl_addons/renderPM/gt1 -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/sqlite/include -I/Users/zulfugar/PycharmProjects/AppForm/.venv/include -I/usr/local/Cellar/python#3.8/3.8.6_1/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/rl_addons/renderPM/gt1/gt1-dict.c -o build/temp.macosx-11.0-x86_64-3.8/src/rl_addons/renderPM/gt1/gt1-dict.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Qunused-arguments -Qunused-arguments -DRENDERPM_FT -DLIBART_COMPILATION -DLIBART_VERSION=2.3.21 -Isrc/rl_addons/renderPM -Isrc/rl_addons/renderPM/libart_lgpl -Isrc/rl_addons/renderPM/gt1 -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/sqlite/include -I/Users/zulfugar/PycharmProjects/AppForm/.venv/include -I/usr/local/Cellar/python#3.8/3.8.6_1/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/rl_addons/renderPM/gt1/gt1-namecontext.c -o build/temp.macosx-11.0-x86_64-3.8/src/rl_addons/renderPM/gt1/gt1-namecontext.o
src/rl_addons/renderPM/gt1/gt1-namecontext.c:100:9: error: implicitly declaring library function 'strlen' with type 'unsigned long (const char *)' [-Werror,-Wimplicit-function-declaration]
len = strlen (s);
^
src/rl_addons/renderPM/gt1/gt1-namecontext.c:100:9: note: include the header <string.h> or explicitly provide a declaration for 'strlen'
src/rl_addons/renderPM/gt1/gt1-namecontext.c:102:3: error: implicitly declaring library function 'memcpy' with type 'void *(void *, const void *, unsigned long)' [-Werror,-Wimplicit-function-declaration]
memcpy (new, s, len);
^
src/rl_addons/renderPM/gt1/gt1-namecontext.c:102:3: note: include the header <string.h> or explicitly provide a declaration for 'memcpy'
src/rl_addons/renderPM/gt1/gt1-namecontext.c:172:10: error: implicitly declaring library function 'strcmp' with type 'int (const char *, const char *)' [-Werror,-Wimplicit-function-declaration]
if (!strcmp (nc->table[i & mask].name, name))
^
src/rl_addons/renderPM/gt1/gt1-namecontext.c:172:10: note: include the header <string.h> or explicitly provide a declaration for 'strcmp'
3 errors generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/zulfugar/PycharmProjects/AppForm/.venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/_w/8xmqn_ys20n91w63y9lcl6nr0000gn/T/pip-install-_q2xgbny/reportlab/setup.py'"'"'; __file__='"'"'/private/var/folders/_w/8xmqn_ys20n91w63y9lcl6nr0000gn/T/pip-install-_q2xgbny/reportlab/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/_w/8xmqn_ys20n91w63y9lcl6nr0000gn/T/pip-record-08bq_70o/install-record.txt --single-version-externally-managed --compile --install-headers /Users/zulfugar/PycharmProjects/AppForm/.venv/include/site/python3.8/reportlab Check the logs for full command output.
I tried:
Reinstall xcode-select --install;
Reinstalled Python brew install python#3.8;
Installed Xcode itself;
None of above helped.
What can be the issue?
this worked for me
CFLAGS="-Wno-error=implicit-function-declaration" pip install reportlab
I found that updating my pip requirements.txt pinned version of reportlab from 3.3.x to 3.5.59 (latest as of today) resolved this issue for me.
I have not yet done any validation of the changes between those versions. YMMV!
Fixed issue by downloading source code and updating src/rl_addons/renderPM/gt1/gt1-namecontext.c
There was
#if defined(_WIN32) || defined(macintosh)
# include <string.h>
#endif
Seems macintosh is not defined on MacOS Big Sur, added include <string.h> without if statement and build using python setup.py install
Worked.

quickfix for python installation failing on MacOS

I am trying to install the quickfix FIX engine module for python on Centos7/Ubuntu16 and MacOSX. I followed the instructions on http://www.quickfixengine.org/quickfix/doc/html/
The installation on Centos/Ubuntu works perfectly with a pip3.6 install quickfix; however I keep getting errors on MacOSX Mojave 10.14
First I ran a xcode-select --install to install command line tools and then I brew install gcc.
Finally I executed the pip3 install quickfix. This command kept failing with a long error log like so:
Collecting quickfix
Downloading https://files.pythonhosted.org/packages/62/b0/caf2dfae8779551f6e1d2bc78668d8f5a2303d21311fdd54345722b68cbc/quickfix-1.15.1.tar.gz (1.5MB)
|████████████████████████████████| 1.5MB 8.0MB/s
Building wheels for collected packages: quickfix
Building wheel for quickfix (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-install-ntpginoa/quickfix/setup.py'"'"'; __file__='"'"'/private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-install-ntpginoa/quickfix/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-wheel-dk9t7tmj --python-tag cp36
cwd: /private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-install-ntpginoa/quickfix/
Complete output (56 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-3.6
copying quickfix.py -> build/lib.macosx-10.6-intel-3.6
copying quickfixt11.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix40.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix41.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix42.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix43.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix44.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix50.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix50sp1.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix50sp2.py -> build/lib.macosx-10.6-intel-3.6
running build_ext
Testing for std::tr1::shared_ptr...
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -DPYTHON_MAJOR_VERSION=3 -IC++ -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c test_std_tr1_shared_ptr.cpp -o test_std_tr1_shared_ptr.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
test_std_tr1_shared_ptr.cpp:1:10: fatal error: 'tr1/memory' file not found
#include <tr1/memory>
^~~~~~~~~~~~
1 warning and 1 error generated.
...not found
Testing for std::shared_ptr...
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -std=c++0x -DPYTHON_MAJOR_VERSION=3 -IC++ -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c test_std_shared_ptr.cpp -o test_std_shared_ptr.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
test_std_shared_ptr.cpp:1:10: fatal error: 'memory' file not found
#include <memory>
^~~~~~~~
1 warning and 1 error generated.
...not found
Testing for std::unique_ptr...
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -std=c++0x -DPYTHON_MAJOR_VERSION=3 -IC++ -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c test_std_unique_ptr.cpp -o test_std_unique_ptr.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
test_std_unique_ptr.cpp:1:10: fatal error: 'memory' file not found
#include <memory>
^~~~~~~~
1 warning and 1 error generated.
...not found
building '_quickfix' extension
creating build/temp.macosx-10.6-intel-3.6
creating build/temp.macosx-10.6-intel-3.6/C++
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -DPYTHON_MAJOR_VERSION=3 -IC++ -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c C++/DataDictionaryProvider.cpp -o build/temp.macosx-10.6-intel-3.6/C++/DataDictionaryProvider.o -std=c++0x -Wno-deprecated -Wno-unused-variable -Wno-deprecated-declarations -Wno-maybe-uninitialized
warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option]
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from C++/DataDictionaryProvider.cpp:26:
In file included from C++/DataDictionaryProvider.h:29:
In file included from C++/DataDictionary.h:29:
In file included from C++/Fields.h:25:
In file included from C++/FixFields.h:4:
C++/Field.h:29:10: fatal error: 'sstream' file not found
#include <sstream>
^~~~~~~~~
2 warnings and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for quickfix
Running setup.py clean for quickfix
Failed to build quickfix
Installing collected packages: quickfix
Running setup.py install for quickfix ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-install-ntpginoa/quickfix/setup.py'"'"'; __file__='"'"'/private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-install-ntpginoa/quickfix/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/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-record-s677l2km/install-record.txt --single-version-externally-managed --compile
cwd: /private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-install-ntpginoa/quickfix/
Complete output (56 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-3.6
copying quickfix.py -> build/lib.macosx-10.6-intel-3.6
copying quickfixt11.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix40.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix41.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix42.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix43.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix44.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix50.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix50sp1.py -> build/lib.macosx-10.6-intel-3.6
copying quickfix50sp2.py -> build/lib.macosx-10.6-intel-3.6
running build_ext
Testing for std::tr1::shared_ptr...
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -DPYTHON_MAJOR_VERSION=3 -IC++ -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c test_std_tr1_shared_ptr.cpp -o test_std_tr1_shared_ptr.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
test_std_tr1_shared_ptr.cpp:1:10: fatal error: 'tr1/memory' file not found
#include <tr1/memory>
^~~~~~~~~~~~
1 warning and 1 error generated.
...not found
Testing for std::shared_ptr...
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -std=c++0x -DPYTHON_MAJOR_VERSION=3 -IC++ -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c test_std_shared_ptr.cpp -o test_std_shared_ptr.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
test_std_shared_ptr.cpp:1:10: fatal error: 'memory' file not found
#include <memory>
^~~~~~~~
1 warning and 1 error generated.
...not found
Testing for std::unique_ptr...
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -std=c++0x -DPYTHON_MAJOR_VERSION=3 -IC++ -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c test_std_unique_ptr.cpp -o test_std_unique_ptr.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
test_std_unique_ptr.cpp:1:10: fatal error: 'memory' file not found
#include <memory>
^~~~~~~~
1 warning and 1 error generated.
...not found
building '_quickfix' extension
creating build/temp.macosx-10.6-intel-3.6
creating build/temp.macosx-10.6-intel-3.6/C++
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -DPYTHON_MAJOR_VERSION=3 -IC++ -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c C++/DataDictionaryProvider.cpp -o build/temp.macosx-10.6-intel-3.6/C++/DataDictionaryProvider.o -std=c++0x -Wno-deprecated -Wno-unused-variable -Wno-deprecated-declarations -Wno-maybe-uninitialized
warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option]
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from C++/DataDictionaryProvider.cpp:26:
In file included from C++/DataDictionaryProvider.h:29:
In file included from C++/DataDictionary.h:29:
In file included from C++/Fields.h:25:
In file included from C++/FixFields.h:4:
C++/Field.h:29:10: fatal error: 'sstream' file not found
#include <sstream>
^~~~~~~~~
2 warnings and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-install-ntpginoa/quickfix/setup.py'"'"'; __file__='"'"'/private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-install-ntpginoa/quickfix/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/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-record-s677l2km/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
I then proceeded to install from src code. so I downloaded the zip package and ran:
./bootstrap
./configure --with-python3
make
this produced the following errors after make:
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in UnitTest++
make[2]: Nothing to be done for `all'.
Making all in src
Making all in C++
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in test
make[5]: Nothing to be done for `all'.
rm -rf ../../lib/libquickfix.a
rm -rf ../../lib/libquickfix.la
rm -rf ../../lib/libquickfix.so
rm -rf ../../lib/libquickfix.dylib
ln -s ../src/C++/.libs/libquickfix.a ../../lib/libquickfix.a
ln -s ../src/C++/.libs/libquickfix.la ../../lib/libquickfix.la
ln -s ../src/C++/.libs/libquickfix.so ../../lib/libquickfix.so
ln -s ../src/C++/.libs/libquickfix.dylib ../../lib/libquickfix.dylib
bash ./copy.sh ../../include/quickfix *.h
: command not found
: invalid option11: set: -
set: usage: set [--abefhkmnptuvxBCHP] [-o option] [arg ...]
: command not found
: command not found shift
: command not found
'/copy.sh: line 17: syntax error near unexpected token `do
'/copy.sh: line 17: `do
make[5]: *** [all-local] Error 2
make[4]: *** [all-recursive] Error 1
make[3]: *** [all] Error 2
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
I cannot find anything in their docs which is very very minimal nor on Stack Overflow. I am aware that I can continue my dev on a centos or ubuntu but I would really like it to work on Mac as well.

How to fix : collect2: error: ld returned 1 exit status error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

I tried to install a pygrib package. in python 2.
I install all required package. (https://jswhit.github.io/pygrib/docs/pygrib-module.html)
I command pip installs pygrib. but it has an error.
I can't find an error in the error script. there are many warnings. but I don't think that's no problem that doesn't install.
how can fix this error?
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-KuwhgZ/pygrib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-KuwhgZ/pygrib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-TKG3Ld --python-tag cp27
cwd: /tmp/pip-install-KuwhgZ/pygrib/
Complete output (38 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying ncepgrib2.py -> build/lib.linux-x86_64-2.7
running build_ext
skipping 'pygrib.c' Cython extension (up-to-date)
building 'pygrib' extension
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -Ig2clib_src -I/usr/include/python2.7 -c pygrib.c -o build/temp.linux-x86_64-2.7/pygrib.o
In file included from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0,
from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
from pygrib.c:613:
/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it with " \
^
pygrib.c: In function '__pyx_pf_6pygrib_11gribmessage_16keys':
pygrib.c:13996:18: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_name = grib_keys_iterator_get_name(__pyx_v_gi);
^
pygrib.c: In function '__pyx_pf_6pygrib_11gribmessage_18_read_only_keys':
pygrib.c:14427:18: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_name = grib_keys_iterator_get_name(__pyx_v_gi);
^
pygrib.c: In function '__pyx_pf_6pygrib_11gribmessage_30tostring':
pygrib.c:18559:53: warning: passing argument 2 of 'grib_get_message' from incompatible pointer type [-Wincompatible-pointer-types]
__pyx_v_err = grib_get_message(__pyx_v_self->_gh, (&__pyx_v_message), (&__pyx_v_size));
^
In file included from pygrib.c:614:0:
/usr/include/grib_api.h:554:5: note: expected 'const void **' but argument is of type 'void **'
int grib_get_message(grib_handle* h ,const void** message, size_t *message_length);
^
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/pygrib.o -leccodes -o build/lib.linux-x86_64-2.7/pygrib.so
/usr/bin/ld: cannot find -leccodes
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pygrib
Running setup.py clean for pygrib
Failed to build pygrib
Installing collected packages: pygrib
Running setup.py install for pygrib ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-KuwhgZ/pygrib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-KuwhgZ/pygrib/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-NTYS3Y/install-record.txt --single-version-externally-managed --compile
cwd: /tmp/pip-install-KuwhgZ/pygrib/
Complete output (38 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying ncepgrib2.py -> build/lib.linux-x86_64-2.7
running build_ext
skipping 'pygrib.c' Cython extension (up-to-date)
building 'pygrib' extension
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -Ig2clib_src -I/usr/include/python2.7 -c pygrib.c -o build/temp.linux-x86_64-2.7/pygrib.o
In file included from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0,
from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
from pygrib.c:613:
/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it with " \
^
pygrib.c: In function '__pyx_pf_6pygrib_11gribmessage_16keys':
pygrib.c:13996:18: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_name = grib_keys_iterator_get_name(__pyx_v_gi);
^
pygrib.c: In function '__pyx_pf_6pygrib_11gribmessage_18_read_only_keys':
pygrib.c:14427:18: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_name = grib_keys_iterator_get_name(__pyx_v_gi);
^
pygrib.c: In function '__pyx_pf_6pygrib_11gribmessage_30tostring':
pygrib.c:18559:53: warning: passing argument 2 of 'grib_get_message' from incompatible pointer type [-Wincompatible-pointer-types]
__pyx_v_err = grib_get_message(__pyx_v_self->_gh, (&__pyx_v_message), (&__pyx_v_size));
^
In file included from pygrib.c:614:0:
/usr/include/grib_api.h:554:5: note: expected 'const void **' but argument is of type 'void **'
int grib_get_message(grib_handle* h ,const void** message, size_t *message_length);
^
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/pygrib.o -leccodes -o build/lib.linux-x86_64-2.7/pygrib.so
/usr/bin/ld: cannot find -leccodes
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-KuwhgZ/pygrib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-KuwhgZ/pygrib/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-NTYS3Y/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
The operant part is cannot find -leccodes, which means it cant find the library libeccodes.so
To install it, you want to do
sudo apt install libeccodes-dev
The latest versions of pygrib, since version 2.0.2, require usage of an ECMWF package called ecCodes which replaces grib-api. Your gcc exit code is saying that you are missing "-leccodes' compile flag.
ecCodes can be found here: https://confluence.ecmwf.int/display/ECC/ecCodes+Home
And here is where grib-api is announced to be replaced by ecCodes: https://confluence.ecmwf.int/display/GRIB/Home
Installing the ecCodes package should provide the gcc flag "-leccodes'

Pip installation of pygdal with osx gdal binding fails

I'm trying to run a geoDjango project on OSX Mojave (10.14.5).
Therefore I've installed the dependencies as suggested on the Django docs from kyngchaos (tried brew packages as well)
Created my virtualenv which shows
New python executable in /Users/ts/.virtualenvs/project_upstream/bin/python2.7
Also creating executable in /Users/ts/.virtualenvs/project_upstream/bin/python
checked gdal with
$ gdal-config --version
2.4.1
and tried to install pygdal with:
pip install pygdal==2.4.1.*
which fails with
ERROR: Complete output from command /Users/ts/.virtualenvs/project_upstream/bin/python2.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/j6/wr2vpjzn3698tdsng2j56d7m0000gn/T/pip-install-qTnsBS/pygdal/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/j6/wr2vpjzn3698tdsng2j56d7m0000gn/T/pip-record-vlffrN/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ts/.virtualenvs/project_upstream/bin/../include/site/python2.7/pygdal:
ERROR: running install
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-2.7
creating build/lib.macosx-10.14-x86_64-2.7/osgeo
copying osgeo/gnm.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
copying osgeo/__init__.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
copying osgeo/gdalnumeric.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
copying osgeo/osr.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
copying osgeo/gdal.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
copying osgeo/ogr.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
copying osgeo/gdal_array.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
copying osgeo/gdalconst.py -> build/lib.macosx-10.14-x86_64-2.7/osgeo
running build_ext
clang -fno-strict-aliasing -fno-common -dynamic -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Users/ts/.virtualenvs/project_upstream/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/GDAL.framework/Versions/2.4/include/gdal -I/Library/Frameworks/GDAL.framework/Versions/2.4/include -c gdal_python_cxx11_test.cpp -o gdal_python_cxx11_test.o
clang -fno-strict-aliasing -fno-common -dynamic -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Users/ts/.virtualenvs/project_upstream/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/GDAL.framework/Versions/2.4/include/gdal -I/Library/Frameworks/GDAL.framework/Versions/2.4/include -c gdal_python_cxx11_test.cpp -o gdal_python_cxx11_test.o -std=c++11
building 'osgeo._gdal' extension
creating build/temp.macosx-10.14-x86_64-2.7
creating build/temp.macosx-10.14-x86_64-2.7/extensions
clang -fno-strict-aliasing -fno-common -dynamic -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Users/ts/.virtualenvs/project_upstream/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/GDAL.framework/Versions/2.4/include/gdal -I/Library/Frameworks/GDAL.framework/Versions/2.4/include -c extensions/gdal_wrap.cpp -o build/temp.macosx-10.14-x86_64-2.7/extensions/gdal_wrap.o -std=c++11 -I/Library/Frameworks/GDAL.framework/Versions/2.4/Headers
In file included from extensions/gdal_wrap.cpp:173:
In file included from /usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:88:
/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:534:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
register PyObject *obj, /* Object */
^~~~~~~~~
/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:553:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
register PyObject *obj /* Object */
^~~~~~~~~
/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:575:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
register const wchar_t *w, /* wchar_t buffer */
^~~~~~~~~
/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:593:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
register wchar_t *w, /* wchar_t buffer */
^~~~~~~~~
In file included from extensions/gdal_wrap.cpp:173:
In file included from /usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:97:
/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:173:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
register PyObject *obj, /* string or Unicode object */
^~~~~~~~~
/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:174:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
register char **s, /* pointer to buffer variable */
^~~~~~~~~
/usr/local/Cellar/python#2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:175:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
register Py_ssize_t *len /* pointer to length variable or NULL
^~~~~~~~~
7 warnings generated.
clang++ -bundle -undefined dynamic_lookup -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk build/temp.macosx-10.14-x86_64-2.7/extensions/gdal_wrap.o -L/Library/Frameworks/GDAL.framework/Versions/2.4/lib -lgdal -o build/lib.macosx-10.14-x86_64-2.7/osgeo/_gdal.so
ld: warning: directory not found for option '-L/Library/Frameworks/GDAL.framework/Versions/2.4/lib'
ld: library not found for -lgdal
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang++' failed with exit status 1
----------------------------------------
ERROR: Command "/Users/ts/.virtualenvs/project_upstream/bin/python2.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/j6/wr2vpjzn3698tdsng2j56d7m0000gn/T/pip-install-qTnsBS/pygdal/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/j6/wr2vpjzn3698tdsng2j56d7m0000gn/T/pip-record-vlffrN/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ts/.virtualenvs/project_upstream/bin/../include/site/python2.7/pygdal" failed with error code 1 in /private/var/folders/j6/wr2vpjzn3698tdsng2j56d7m0000gn/T/pip-install-qTnsBS/pygdal/
To solve this I've removed all packages and reinstalled. Further tried different packages from brew and kynchaos and instructions found at this issue without luck.
The strange thing is I can install pygdal without problems using no virtualenv!
Does one know how to overcome this error – what might be the reason for it?
The problem was solved by reinstalling virtualenv

Python M2Crypto installation fails in Fedora 26

I am running Fedora 26 in my PC and python version is 2.7. I have already installed
openssl-devel
package.
Now I am trying to install
M2Crypto==0.25.1
package inside python virtual environment using the command
pip install M2Crypto==0.25.1
. Installation always fails with following log statement.
Collecting M2Crypto==0.25.1
Using cached M2Crypto-0.25.1.tar.gz
Requirement already satisfied: typing in ./site-packages (from M2Crypto==0.25.1)
Building wheels for collected packages: M2Crypto
Running setup.py bdist_wheel for M2Crypto ... error
Complete output from command /home/udara/Projects/Dev/moota/ENV/new_env/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-NIhR7v/M2Crypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmptqERYXpip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_py
copying M2Crypto/util.py -> build/lib.linux-x86_64-2.7/M2Crypto
-----
-----
copying M2Crypto/PGP/PublicKey.py -> build/lib.linux-x86_64-2.7/M2Crypto/PGP
running build_ext
building 'M2Crypto.__m2crypto' extension
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
swig -python -D__x86_64__ -I/usr/include/python2.7 -I/usr/include -I/usr/include/openssl -includeall -modern -builtin -outdir build/lib.linux-x86_64-2.7/M2Crypto -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
/usr/include/sys/cdefs.h:175: Warning 305: Bad constant value (ignored).
/usr/include/bits/wchar.h:38: Warning 490: Fragment 'SWIG_From_wchar_t' not found.
/usr/include/stdint.h:274: Warning 490: Fragment 'SWIG_From_wchar_t' not found.
SWIG/_bio.i:64: Warning 454: Setting a pointer/reference variable may leak memory.
-----
-----
SWIG/_engine.i:168: Warning 454: Setting a pointer/reference variable may leak memory.
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/SWIG
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -I/usr/include -I/usr/include/openssl -I/tmp/pip-build-NIhR7v/M2Crypto/SWIG -c SWIG/_m2crypto_wrap.c -o build/temp.linux-x86_64-2.7/SWIG/_m2crypto_wrap.o -DTHREADING
SWIG/_m2crypto_wrap.c:4185:35: error: ‘CRYPTO_NUM_LOCKS’ undeclared here (not in a function); did you mean ‘CRYPTO_UNLOCK’?
static PyThread_type_lock lock_cs[CRYPTO_NUM_LOCKS];
^~~~~~~~~~~~~~~~
CRYPTO_UNLOCK
SWIG/_m2crypto_wrap.c: In function ‘lib_init’:
SWIG/_m2crypto_wrap.c:4590:5: warning: implicit declaration of function ‘SSLeay_add_all_algorithms’; did you mean ‘SSLeay_add_ssl_algorithms’? [-Wimplicit-function-declaration]
SSLeay_add_all_algorithms();
^~~~~~~~~~~~~~~~~~~~~~~~~
SSLeay_add_ssl_algorithms
SWIG/_m2crypto_wrap.c: In function ‘bn_rand’:
SWIG/_m2crypto_wrap.c:5029:12: error: storage size of ‘rnd’ isn’t known
BIGNUM rnd;
^~~
SWIG/_m2crypto_wrap.c:5033:5: warning: implicit declaration of function ‘BN_init’; did you mean ‘bio_init’? [-Wimplicit-function-declaration]
BN_init(&rnd);
^~~~~~~
bio_init
SWIG/_m2crypto_wrap.c:5029:12: warning: unused variable ‘rnd’ [-Wunused-variable]
BIGNUM rnd;
^~~
SWIG/_m2crypto_wrap.c: In function ‘bn_rand_range’:
SWIG/_m2crypto_wrap.c:5058:12: error: storage size of ‘rnd’ isn’t known
BIGNUM rnd;
^~~
SWIG/_m2crypto_wrap.c:5058:12: warning: unused variable ‘rnd’ [-Wunused-variable]
SWIG/_m2crypto_wrap.c: In function ‘rand_pseudo_bytes’:
SWIG/_m2crypto_wrap.c:5209:5: warning: ‘RAND_pseudo_bytes’ is deprecated [-Wdeprecated-declarations]
ret = RAND_pseudo_bytes(blob, n);
^~~
In file included from /usr/include/openssl/opensslconf.h:42:0,
from /usr/include/openssl/crypto.h:32,
from /usr/include/openssl/bio.h:20,
from /usr/include/openssl/err.h:21,
from SWIG/_m2crypto_wrap.c:3828:
/usr/include/openssl/rand.h:47:1: note: declared here
DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num))
Try using compat-openssl10-devel:
sudo dnf install compat-openssl10-devel --allowerasing
You may have to remove open-ssl if this conflicts with it. You can reinstall open-ssl after installing M2Crypto

Categories

Resources