pycryptodome setup.py causing an error when installing pyrebase - python

I am trying to install Pyrebase, but I keep getting an error that I believe is caused by setup.py for pycryptodome. I have searched all over but cannot find a solution, does anyone know how to solve this?
My output is below - I added in (...) in places to truncate the output, which was creating and copying libraries.
Thanks for the help
(backend-ragxWAh7) bash-3.2$ pip install Pyrebase
Collecting Pyrebase
(...)
Building wheels for collected packages: pycryptodome
Running setup.py bdist_wheel for pycryptodome ... error
Complete output from command /Users/rafilurie/.local/share/virtualenvs/backend-ragxWAh7/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-install-q_NyfS/pycryptodome/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/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-wheel-8ox7HU --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14-intel-2.7
creating build/lib.macosx-10.14-intel-2.7/Crypto
copying lib/Crypto/__init__.py -> build/lib.macosx-10.14-intel-2.7/Crypto
(...)
copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS/SigVerPSS_186-3.rsp -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS
warning: PCTBuildPy: byte-compiling is disabled, skipping.
running build_ext
warning: no support for Intel AESNI instructions
building 'Crypto.Hash._MD2' extension
creating build/temp.macosx-10.14-intel-2.7
creating build/temp.macosx-10.14-intel-2.7/src
cc -fno-strict-aliasing -fno-common -dynamic -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 -DLTC_NO_ASM -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MD2.c -o build/temp.macosx-10.14-intel-2.7/src/MD2.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'cc' failed with exit status 1
----------------------------------------
Failed building wheel for pycryptodome
Running setup.py clean for pycryptodome
Failed to build pycryptodome
Installing collected packages: pycryptodome, Pyrebase
Running setup.py install for pycryptodome ... error
Complete output from command /Users/rafilurie/.local/share/virtualenvs/backend-ragxWAh7/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-install-q_NyfS/pycryptodome/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/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-record-1TJZWz/install-record.txt --single-version-externally-managed --compile --install-headers /Users/rafilurie/.local/share/virtualenvs/backend-ragxWAh7/include/site/python2.7/pycryptodome:
running install
running build
running build_py
(...)
creating build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5
copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5/SigVer15_186-3.rsp -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5
copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5/SigGen15_186-3.txt -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5
copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5/SigGen15_186-2.txt -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5
creating build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS
copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS/SigGenPSS_186-2.txt -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS
copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS/SigGenPSS_186-3.txt -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS
copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS/SigVerPSS_186-3.rsp -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS
warning: PCTBuildPy: byte-compiling is disabled, skipping.
running build_ext
warning: no support for Intel AESNI instructions
building 'Crypto.Hash._MD2' extension
creating build/temp.macosx-10.14-intel-2.7
creating build/temp.macosx-10.14-intel-2.7/src
cc -fno-strict-aliasing -fno-common -dynamic -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 -DLTC_NO_ASM -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MD2.c -o build/temp.macosx-10.14-intel-2.7/src/MD2.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'cc' failed with exit status 1
----------------------------------------
Command "/Users/rafilurie/.local/share/virtualenvs/backend-ragxWAh7/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-install-q_NyfS/pycryptodome/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/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-record-1TJZWz/install-record.txt --single-version-externally-managed --compile --install-headers /Users/rafilurie/.local/share/virtualenvs/backend-ragxWAh7/include/site/python2.7/pycryptodome" failed with error code 1 in /private/var/folders/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-install-q_NyfS/pycryptodome/

You don't have a valid C compiler environment (xcode).
See also here: https://apple.stackexchange.com/questions/254380/macos-mojave-invalid-active-developer-path.

install pycryptodome from github
go into lib/Crypto/PublicKey
get RSA.py file from there
and import it into pyerbase.py file as single file like import rsa

Related

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.

Error while trying to install pycurl in Synology NAS

I am using synology NAS and python(installed 2.7, 3.5)
when I try to install via PIP, I encounter this error message.
(the first time, I met curl-config not found error.
but now with several entware packages, I met with the message below)
----------
python3 -m pip install pycurl
Collecting pycurl
Using cached pycurl-7.43.0.tar.gz
Building wheels for collected packages: pycurl
Running setup.py bdist_wheel for pycurl ... error
Complete output from command /usr/local/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-79dqoc3v/pycurl/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/tmpa8e0oiyqpip-wheel- --python-tag cp35:
Using curl-config (libcurl 7.55.0)
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/curl
copying python/curl/__init__.py -> build/lib.linux-x86_64-3.5/curl
running build_ext
building 'pycurl' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/src
/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DSYNO_FIX_FLAG_BUG -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -DSYNOPLAT_F_X86_64 -O2 -include /usr/syno/include/platformconfig.h -DSYNO_ENVIRONMENT -DBUILD_ARCH=64 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g -DSDK_VER_MIN_REQUIRED=600 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -fPIC -DPYCURL_VERSION="7.43.0" -DHAVE_CURL_SSL=1 -I/opt/include -I/volume1/#appstore/py3k/usr/local/include/python3.5m -c src/docstrings.c -o build/temp.linux-x86_64-3.5/src/docstrings.o
unable to execute '/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc': No such file or directory
error: command '/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for pycurl
Running setup.py clean for pycurl
Failed to build pycurl
Installing collected packages: pycurl
Running setup.py install for pycurl ... error
Complete output from command /usr/local/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-79dqoc3v/pycurl/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-q_rurvzr-record/install-record.txt --single-version-externally-managed --compile:
Using curl-config (libcurl 7.55.0)
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/curl
copying python/curl/__init__.py -> build/lib.linux-x86_64-3.5/curl
running build_ext
building 'pycurl' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/src
/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DSYNO_FIX_FLAG_BUG -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -DSYNOPLAT_F_X86_64 -O2 -include /usr/syno/include/platformconfig.h -DSYNO_ENVIRONMENT -DBUILD_ARCH=64 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g -DSDK_VER_MIN_REQUIRED=600 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -fPIC -DPYCURL_VERSION="7.43.0" -DHAVE_CURL_SSL=1 -I/opt/include -I/volume1/#appstore/py3k/usr/local/include/python3.5m -c src/docstrings.c -o build/temp.linux-x86_64-3.5/src/docstrings.o
unable to execute '/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc': No such file or directory
error: command '/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc' failed with exit status 1
----------------------------------------
Command "/usr/local/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-79dqoc3v/pycurl/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-q_rurvzr-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-79dqoc3v/pycurl/
I just had this problem too with by Synology DS415+. The only difference is that I tried to install netdisco.
I found that setting the CC environmental variable to the actual location of gcc compiler in advance helped
# export CC=/opt/bin/gcc

GCC error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory

[axaysd#localhost ~]$ sudo pip install lightfm
[sudo] password for axaysd:
Collecting lightfm
Using cached lightfm-1.12.tar.gz
Requirement already satisfied: numpy in /usr/lib64/python2.7/site-packages (from lightfm)
Requirement already satisfied: scipy>=0.17.0 in /usr/lib64/python2.7/site-packages (from lightfm)
Requirement already satisfied: requests in /usr/lib/python2.7/site-packages (from lightfm)
Installing collected packages: lightfm
Running setup.py install for lightfm ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-08iD5u/lightfm/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-T0wh6x-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/lightfm
copying lightfm/_lightfm_fast.py -> build/lib.linux-x86_64-2.7/lightfm
copying lightfm/evaluation.py -> build/lib.linux-x86_64-2.7/lightfm
copying lightfm/__init__.py -> build/lib.linux-x86_64-2.7/lightfm
copying lightfm/lightfm.py -> build/lib.linux-x86_64-2.7/lightfm
creating build/lib.linux-x86_64-2.7/lightfm/datasets
copying lightfm/datasets/movielens.py -> build/lib.linux-x86_64-2.7/lightfm/datasets
copying lightfm/datasets/stackexchange.py -> build/lib.linux-x86_64-2.7/lightfm/datasets
copying lightfm/datasets/_common.py -> build/lib.linux-x86_64-2.7/lightfm/datasets
copying lightfm/datasets/__init__.py -> build/lib.linux-x86_64-2.7/lightfm/datasets
copying lightfm/_lightfm_fast_no_openmp.c -> build/lib.linux-x86_64-2.7/lightfm
copying lightfm/_lightfm_fast_openmp.c -> build/lib.linux-x86_64-2.7/lightfm
running build_ext
building 'lightfm._lightfm_fast_openmp' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/lightfm
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 -c lightfm/_lightfm_fast_openmp.c
-o build/temp.linux-x86_64-
**gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-08iD5u/lightfm/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-T0wh6x-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-08iD5u/lightfm/**
On Fedora 24, this worked for me:
sudo dnf install redhat-rpm-config
Source: https://bugs.launchpad.net/openstack-gate/+bug/1424582
'dnf provides filename' (or 'yum provides filename') can usually tell you what packages provide the file that is being complained about:
root#nuc:~/ > dnf provides '/usr/lib/rpm/redhat/redhat-hardened-cc1'
Last metadata expiration check: 0:24:28 ago on Sat 28 Oct 2017 12:53:33 PM EDT.
redhat-rpm-config-63-1.fc26.noarch : Red Hat specific rpm configuration files
Repo : #System
redhat-rpm-config-63-1.fc26.noarch : Red Hat specific rpm configuration files
Repo : fedora
The above response of 'redhat-rpm-config-63-1.fc26.noarch' confirms that Trần's answer is correct. The "provides" command will save your butt more often than you can imagine!

Can't install python mysql library on Mac Mavericks

It was working like a charm before the update from Mountain Lion.
After the update it is broken and I cannot get the environment up again.
Does anybody know how to fix this?
The error is bolded, below.
fedorius#this:~$ pip install mysql-python
Downloading/unpacking mysql-python
Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded
Running setup.py (path:/private/var/folders/21/zjvwzn891jnf4rnp526y13200000gn/T/pip_build_fedorius/mysql-python/setup.py) egg_info for package mysql-python
Installing collected packages: mysql-python
Running setup.py install for mysql-python
building '_mysql' extension
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.9-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing -arch x86_64
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/21/zjvwzn891jnf4rnp526y13200000gn/T/pip_build_fedorius/mysql-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/21/zjvwzn891jnf4rnp526y13200000gn/T/pip-_yi6sy-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-intel-2.7
copying _mysql_exceptions.py -> build/lib.macosx-10.9-intel-2.7
creating build/lib.macosx-10.9-intel-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb
creating build/lib.macosx-10.9-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.9-intel-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.9-intel-2.7
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.9-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing -arch x86_64
**clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1**
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/21/zjvwzn891jnf4rnp526y13200000gn/T/pip_build_fedorius/mysql-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/21/zjvwzn891jnf4rnp526y13200000gn/T/pip-_yi6sy-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/21/zjvwzn891jnf4rnp526y13200000gn/T/pip_build_fedorius/mysql-python
Storing debug log for failure in /var/folders/21/zjvwzn891jnf4rnp526y13200000gn/T/tmp5QBn55
UPDATE:
As suggested, I've added
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
But it changed the error to
error: /Library/Python/2.7/site-packages/_mysql.so: Permission denied
I just chmoded this directory to allow writing and it worked :)
This is due to mixing macports, easy_install and pip... shame on me.
The problem is due to changes introduced in Xcode 5.1 and due to the way the Apple-supplied system Python 2.7 is built. Try adding these environment variable values before running pip:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
See clang error: unknown argument: '-mno-fused-madd' (python package installation failure) for more information.
UPDATE [2014-05-16]: As expected, Apple has fixed this problem with updated system Pythons (2.7, 2.6, and 2.5) in OS X 10.9.3 so the workaround is no longer necessary when using the latest Mavericks and Xcode 5.1+. However, as of now, the workaround is still required for OS X 10.8.x (Mountain Lion, currently 10.8.5) if you are using Xcode 5.1+ there.
Building on Ned's answer:
Since I don't want to use sudo to install packages (I am using virtual environments) or affect my golbal environment, I added the two variables to the single execution of pip install:
CFLAGS=-Qunused-arguments CPPFLAGS=-Qunused-arguments pip install -r requirements.txt

Build errors when trying to install pylibmc

Just got a new laptop, setting up my dev environment from scratch, and I'm getting this weird error that doesn't seem to be a result of missing dependencies (though I could be wrong). I'm working in a virtualenv with Python 2.7.3. Libevent, libmemcached and memcached were all installed with Homebrew earlier.
(grlli)Tylers-MacBook-Pro:grlli tyler$ pip install pylibmc
Downloading/unpacking pylibmc
Running setup.py egg_info for package pylibmc
Installing collected packages: pylibmc
Running setup.py install for pylibmc
building '_pylibmc' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -DUSE_ZLIB -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _pylibmcmodule.c -o build/temp.macosx-10.8-intel-2.7/_pylibmcmodule.o -fno-strict-aliasing
_pylibmcmodule.c:1895:33: error: member reference base type 'const void' is not a structure or union
svr->hostname, svr->port);
~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/secure/_stdio.h:56:62: note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
^
1 error generated.
error: command 'cc' failed with exit status 1
Complete output from command /Users/tyler/projects/envs/grlli/bin/python -c "import setuptools;__file__='/Users/tyler/projects/envs/grlli/build/pylibmc/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/1_/jkd0_x495gs0g8v7z2pgz3bc0000gn/T/pip-E_pLFk-record/install-record.txt --single-version-externally-managed --install-headers /Users/tyler/projects/envs/grlli/bin/../include/site/python2.7:
running install
running build
running build_py
running build_ext
building '_pylibmc' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -DUSE_ZLIB -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _pylibmcmodule.c -o build/temp.macosx-10.8-intel-2.7/_pylibmcmodule.o -fno-strict-aliasing
_pylibmcmodule.c:1895:33: error: member reference base type 'const void' is not a structure or union
svr->hostname, svr->port);
~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/secure/_stdio.h:56:62: note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
^
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Command /Users/tyler/projects/envs/grlli/bin/python -c "import setuptools;__file__='/Users/tyler/projects/envs/grlli/build/pylibmc/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/1_/jkd0_x495gs0g8v7z2pgz3bc0000gn/T/pip-E_pLFk-record/install-record.txt --single-version-externally-managed --install-headers /Users/tyler/projects/envs/grlli/bin/../include/site/python2.7 failed with error code 1 in /Users/tyler/projects/envs/grlli/build/pylibmc
Storing complete log in /Users/tyler/.pip/pip.log
Any help is greatly appreciated!
I ran into the same issue. The one thing that fixed it for me was updating setuptools to the latest version.
pip install setuptools --upgrade
Try to install pylibmc 1.2.3, it helped me.

Categories

Resources