quickfix for python installation failing on MacOS - python

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.

Related

Cython_bbox and lap installation error, #include "Python.h" not found

I have encountered these strange errors upon trying to install these 2 libraries (Cython_bbox and lap), which are part of other libraries that I need when running pip install -r requirements.txt,
which contains the following
yacs
opencv-python
PyYAML
cython-bbox
scipy
progress
motmetrics
matplotlib
lap
openpyxl
Pillow
tensorboardX
fvcore
This is found from the following link at :https://github.com/ifzhang/FairMOT
This is the big bunch of errors that I got.
rc/cython_bbox.c:31:10: fatal error: Python.h: No such file or directory
31 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for cython-bbox
Running setup.py clean for cython-bbox
Building wheel for lap (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/aevas/Desktop/pyenvs/fairmotpy39/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-dweujmo4/lap_14d06a4a011f45a69d78f1a214bd5715/setup.py'"'"'; __file__='"'"'/tmp/pip-install-dweujmo4/lap_14d06a4a011f45a69d78f1a214bd5715/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-pzh48d16
cwd: /tmp/pip-install-dweujmo4/lap_14d06a4a011f45a69d78f1a214bd5715/
Complete output (34 lines):
Partial import of lap during the build process.
Generating cython files
running bdist_wheel
running build
running config_cc
running config_fc
running build_src
SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/lap
copying lap/lapmod.py -> build/lib.linux-x86_64-3.9/lap
copying lap/__init__.py -> build/lib.linux-x86_64-3.9/lap
running build_ext
creating /tmp/tmpijpimqcg/home
creating /tmp/tmpijpimqcg/home/aevas
creating /tmp/tmpijpimqcg/home/aevas/Desktop
creating /tmp/tmpijpimqcg/home/aevas/Desktop/pyenvs
creating /tmp/tmpijpimqcg/home/aevas/Desktop/pyenvs/fairmotpy39
creating /tmp/tmpijpimqcg/home/aevas/Desktop/pyenvs/fairmotpy39/lib
creating /tmp/tmpijpimqcg/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9
creating /tmp/tmpijpimqcg/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages
creating /tmp/tmpijpimqcg/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy
creating /tmp/tmpijpimqcg/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy/distutils
creating /tmp/tmpijpimqcg/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy/distutils/checks
CCompilerOpt.generate_dispatch_header[2281] : dispatch header dir build/src.linux-x86_64-3.9/numpy/distutils/include does not exist, creating it
creating build/temp.linux-x86_64-3.9/lap
lap/_lapjv.cpp:4:10: fatal error: Python.h: No such file or directory
4 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: Command "x86_64-linux-gnu-g++ -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-FZ7wim/python3.9-3.9.5=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy/core/include -Ilap -I/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy/core/include -Ibuild/src.linux-x86_64-3.9/numpy/distutils/include -I/home/aevas/Desktop/pyenvs/fairmotpy39/include -I/usr/include/python3.9 -c lap/_lapjv.cpp -o build/temp.linux-x86_64-3.9/lap/_lapjv.o -MMD -MF build/temp.linux-x86_64-3.9/lap/_lapjv.o.d -msse -msse2 -msse3" failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for lap
Running setup.py install for lap ... error
ERROR: Command errored out with exit status 1:
warnings.warn(
running build
running config_cc
running config_fc
running build_src
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/lap
copying lap/lapmod.py -> build/lib.linux-x86_64-3.9/lap
copying lap/__init__.py -> build/lib.linux-x86_64-3.9/lap
running build_ext
creating /tmp/tmplmbzif7h/home
creating /tmp/tmplmbzif7h/home/aevas
creating /tmp/tmplmbzif7h/home/aevas/Desktop
creating /tmp/tmplmbzif7h/home/aevas/Desktop/pyenvs
creating /tmp/tmplmbzif7h/home/aevas/Desktop/pyenvs/fairmotpy39
creating /tmp/tmplmbzif7h/home/aevas/Desktop/pyenvs/fairmotpy39/lib
creating /tmp/tmplmbzif7h/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9
creating /tmp/tmplmbzif7h/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages
creating /tmp/tmplmbzif7h/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy
creating /tmp/tmplmbzif7h/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy/distutils
creating /tmp/tmplmbzif7h/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy/distutils/checks
CCompilerOpt.generate_dispatch_header[2281] : dispatch header dir build/src.linux-x86_64-3.9/numpy/distutils/include does not exist, creating it
creating build/temp.linux-x86_64-3.9/lap
lap/_lapjv.cpp:4:10: fatal error: Python.h: No such file or directory
4 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: Command "x86_64-linux-gnu-g++ -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-FZ7wim/python3.9-3.9.5=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy/core/include -Ilap -I/home/aevas/Desktop/pyenvs/fairmotpy39/lib/python3.9/site-packages/numpy/core/include -Ibuild/src.linux-x86_64-3.9/numpy/distutils/include -I/home/aevas/Desktop/pyenvs/fairmotpy39/include -I/usr/include/python3.9 -c lap/_lapjv.cpp -o build/temp.linux-x86_64-3.9/lap/_lapjv.o -MMD -MF build/temp.linux-x86_64-3.9/lap/_lapjv.o.d -msse -msse2 -msse3" failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1:
I was installing it in a brand new virtual environment running python3.9. I am not using any conda environment.
Here are my system specs, if required
11th Gen Intel® Core™ i7-11850H # 2.50GHz × 16
llvmpipe (LLVM 12.0.0, 256 bits) / Mesa Intel® UHD Graphics (TGL GT1)
Ubuntu 21.04 64-bit
Things I've tried
looking through stackoverflow.com/search?q=%23include+%22Python.h%22+not+found
Try this :
sudo apt install libpython3.9-dev
which will install header files like Python.h

boost/thread.hpp: No such file or directory

There are many similar posts with the same error what I am facing, but none of the solutions worked for me. Please do not think this as repeated. I am reaching you out after trying with all the solutions suggested.
I am trying to create a python library from c++ file that uses boost library with
#include <boost/thread.hpp>
I have installed Boost in Ubuntu through the commands
./bootstrap.sh --prefix=/usr/local
and then
./b2 install --with-thread
.
Now, when I try to run a file with #include <boost/thread.hpp> it gives me this error saying
src/main.cpp:2:10: fatal error: boost/thread.hpp: No such file or directory
Am I missing on something? Can someone help me how can I solve this.
Error
I will attach a screenshot of the same for viewing.
Also pasting the error description in-case someone does not feel comfortable to view image
Failed building wheel for python-example
Running setup.py clean for python-example
Failed to build python-example
Installing collected packages: python-example
Running setup.py install for python-example ... error
Complete output from command /home/hmi/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-h4742spy /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-3l3u7dxm/install-record.txt --single-version-externally- managed --compile:
running install
running build
running build_ext
gcc -pthread -B /home/hmi/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/hmi/anaconda3/include/python3.7m -c /tmp/tmpbv27mdxm.cpp -o tmp/tmpbv27mdxm.o -std=c++17
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
gcc -pthread -B /home/hmi/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/hmi/anaconda3/include/python3.7m -c /tmp/tmps2iqs0qp.cpp -o tmp/tmps2iqs0qp.o -fvisibility=hidden
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
building 'python_example' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/src
gcc -pthread -B /home/hmi/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/hmi/anaconda3/include -I/home/hmi/anaconda3/include -I/home/hmi/anaconda3/include/python3.7m -c src/main.cpp -o build/temp.linux-x86_64-3.7/src/main.o -DVERSION_INFO="0.0.1" -std=c++17 -fvisibility=hidden
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
src/main.cpp:2:10: fatal error: boost/thread.hpp: No such file or directory
#include <boost/thread.hpp>
^~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
I have also tried with this command
g++ -std=c++11 main.cpp -lpthread -lboost_system -lboost_thread -o main
. But similar result.
OS : Ubuntu 18.04
Boost version : 1.55
I have now resolved it with the command mentioned by Botje but with sudo.
sudo apt install libboost-thread-dev
But I did not want to do through root. So I have refrained its usage. But now I did not find any other way. I would be glad to know if any other solution works

pycryptodome setup.py causing an error when installing pyrebase

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

Python API: C Extension install error

I'm using Mac, and I am trying to write my own c code to use it from Python. I'm new to this, and trying out a sample example from http://www.tutorialspoint.com/python/python_further_extensions.htm.
But, when I run the setup.py file to install my c file, it gives me an error, and I'm not sure what to do. Below is the resulting error message. Thanks a lot!
$ sudo python3 setup.py install
Password:
running install
running build
running build_ext
building 'sample' extension
clang -Wno-unused-result -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/opt/sqlite/include -DFOO=1 -UBAR -I/some/dir -I/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/include/python3.4m -c pysample.c -o build/temp.macosx-10.10-x86_64-3.4/pysample.o
clang -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.10-x86_64-3.4/pysample.o -L/usr/local/lib -lsample -o build/lib.macosx-10.10-x86_64-3.4/sample.so
ld: library not found for -lsample
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1

pylibmc installation error using pip in python

I am trying to install pylibmc using pip inside my virtual env and getting the below error
pip install pylibmc
Downloading/unpacking pylibmc
Downloading pylibmc-1.3.0.tar.gz (49kB): 49kB downloaded
Running setup.py egg_info for package pylibmc
warning: no files found matching 'LICENSE'
warning: no files found matching 'runtests.py'
warning: no files found matching '*.py' under directory 'pylibmc'
Installing collected packages: pylibmc
Running setup.py install for pylibmc
building '_pylibmc' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DUSE_ZLIB -I/usr/include/python2.7 -c src/_pylibmcmodule.c -o build/temp.linux-x86_64-2.7/src/_pylibmcmodule.o -fno-strict-aliasing
In file included from src/_pylibmcmodule.c:34:0:
src/_pylibmcmodule.h:42:36: fatal error: libmemcached/memcached.h: No such file or directory
#include <libmemcached/memcached.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Complete output from command /home/satyag/.virtualenvs/inwell/bin/python -c "import setuptools;__file__='/home/satyag/.virtualenvs/inwell/build/pylibmc/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-j2sj7j-record/install-record.txt --single-version-externally-managed --install-headers /home/satyag/.virtualenvs/inwell/include/site/python2.7:
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/pylibmc
copying src/pylibmc/__main__.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/test.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/__init__.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/client.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/pools.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/consts.py -> build/lib.linux-x86_64-2.7/pylibmc
running build_ext
building '_pylibmc' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DUSE_ZLIB -I/usr/include/python2.7 -c src/_pylibmcmodule.c -o build/temp.linux-x86_64-2.7/src/_pylibmcmodule.o -fno-strict-aliasing
In file included from src/_pylibmcmodule.c:34:0:
src/_pylibmcmodule.h:42:36: fatal error: libmemcached/memcached.h: No such file or directory
#include <libmemcached/memcached.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /home/user/.virtualenvs/proj/bin/python -c "import setuptools;__file__='/home/user/.virtualenvs/proj/build/pylibmc/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-j2sj7j-record/install-record.txt --single-version-externally-managed --install-headers /home/user/.virtualenvs/proj/include/site/python2.7 failed with error code 1 in /home/user/.virtualenvs/proj/build/pylibmc
Storing complete log in /home/user/.pip/pip.log
So why it is showing me error ? and how to avoid this error.
Edit
Also i tried in this way,
Downloaded the zip file manually at here https://pypi.python.org/pypi/pylibmc and runt the command python setup.py install and i got the below error
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/pylibmc
copying src/pylibmc/__main__.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/test.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/__init__.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/client.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/pools.py -> build/lib.linux-x86_64-2.7/pylibmc
copying src/pylibmc/consts.py -> build/lib.linux-x86_64-2.7/pylibmc
running build_ext
building '_pylibmc' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DUSE_ZLIB -I/usr/include/python2.7 -c src/_pylibmcmodule.c -o build/temp.linux-x86_64-2.7/src/_pylibmcmodule.o -fno-strict-aliasing
In file included from src/_pylibmcmodule.c:34:0:
src/_pylibmcmodule.h:42:36: fatal error: libmemcached/memcached.h: No such file or directory
#include <libmemcached/memcached.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Actually we need to install dev package like below
sudo apt-get install libmemcached-dev

Categories

Resources