MacOS 上 python 安装失败的快速修复

Cry*_*f84 5 python macos installation quickfix fix-protocol

我正在尝试在 Centos7/Ubuntu16 和 MacOSX 上安装适用于 python 的 QuickFix FIX 引擎模块。我按照http://www.quickfixengine.org/quickfix/doc/html/上的说明进行操作

\n

Centos/Ubuntu 上的安装与 ; 完美配合pip3.6 install quickfix。但是我在 MacOSX Mojave 10.14 上不断收到错误

\n

首先我运行 axcode-select --install来安装命令行工具,然后我brew install gcc.

\n

最后我执行了pip3 install quickfix. 该命令一直失败,并出现很长的错误日志,如下所示:

\n
Collecting quickfix\n  Downloading https://files.pythonhosted.org/packages/62/b0/caf2dfae8779551f6e1d2bc78668d8f5a2303d21311fdd54345722b68cbc/quickfix-1.15.1.tar.gz (1.5MB)\n     |\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88\xe2\x96\x88| 1.5MB 8.0MB/s \nBuilding wheels for collected packages: quickfix\n  Building wheel for quickfix (setup.py) ... error\n  ERROR: Command errored out with exit status 1:\n   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\n       cwd: /private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-install-ntpginoa/quickfix/\n  Complete output (56 lines):\n  running bdist_wheel\n  running build\n  running build_py\n  creating build\n  creating build/lib.macosx-10.6-intel-3.6\n  copying quickfix.py -> build/lib.macosx-10.6-intel-3.6\n  copying quickfixt11.py -> build/lib.macosx-10.6-intel-3.6\n  copying quickfix40.py -> build/lib.macosx-10.6-intel-3.6\n  copying quickfix41.py -> build/lib.macosx-10.6-intel-3.6\n  copying quickfix42.py -> build/lib.macosx-10.6-intel-3.6\n  copying quickfix43.py -> build/lib.macosx-10.6-intel-3.6\n  copying quickfix44.py -> build/lib.macosx-10.6-intel-3.6\n  copying quickfix50.py -> build/lib.macosx-10.6-intel-3.6\n  copying quickfix50sp1.py -> build/lib.macosx-10.6-intel-3.6\n  copying quickfix50sp2.py -> build/lib.macosx-10.6-intel-3.6\n  running build_ext\n  Testing for std::tr1::shared_ptr...\n  /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\n  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]\n  test_std_tr1_shared_ptr.cpp:1:10: fatal error: \'tr1/memory\' file not found\n  #include <tr1/memory>\n           ^~~~~~~~~~~~\n  1 warning and 1 error generated.\n   ...not found\n  Testing for std::shared_ptr...\n  /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\n  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]\n  test_std_shared_ptr.cpp:1:10: fatal error: \'memory\' file not found\n  #include <memory>\n           ^~~~~~~~\n  1 warning and 1 error generated.\n  ...not found\n  Testing for std::unique_ptr...\n  /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\n  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]\n  test_std_unique_ptr.cpp:1:10: fatal error: \'memory\' file not found\n  #include <memory>\n           ^~~~~~~~\n  1 warning and 1 error generated.\n  ...not found\n  building \'_quickfix\' extension\n  creating build/temp.macosx-10.6-intel-3.6\n  creating build/temp.macosx-10.6-intel-3.6/C++\n  /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\n  warning: unknown warning option \'-Wno-maybe-uninitialized\'; did you mean \'-Wno-uninitialized\'? [-Wunknown-warning-option]\n  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]\n  In file included from C++/DataDictionaryProvider.cpp:26:\n  In file included from C++/DataDictionaryProvider.h:29:\n  In file included from C++/DataDictionary.h:29:\n  In file included from C++/Fields.h:25:\n  In file included from C++/FixFields.h:4:\n  C++/Field.h:29:10: fatal error: \'sstream\' file not found\n  #include <sstream>\n           ^~~~~~~~~\n  2 warnings and 1 error generated.\n  error: command \'/usr/bin/clang\' failed with exit status 1\n  ----------------------------------------\n  ERROR: Failed building wheel for quickfix\n  Running setup.py clean for quickfix\nFailed to build quickfix\nInstalling collected packages: quickfix\n  Running setup.py install for quickfix ... error\n    ERROR: Command errored out with exit status 1:\n     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\n         cwd: /private/var/folders/6f/3460vndj14x135ms8yf1w13m0000gn/T/pip-install-ntpginoa/quickfix/\n    Complete output (56 lines):\n    running install\n    running build\n    running build_py\n    creating build\n    creating build/lib.macosx-10.6-intel-3.6\n    copying quickfix.py -> build/lib.macosx-10.6-intel-3.6\n    copying quickfixt11.py -> build/lib.macosx-10.6-intel-3.6\n    copying quickfix40.py -> build/lib.macosx-10.6-intel-3.6\n    copying quickfix41.py -> build/lib.macosx-10.6-intel-3.6\n    copying quickfix42.py -> build/lib.macosx-10.6-intel-3.6\n    copying quickfix43.py -> build/lib.macosx-10.6-intel-3.6\n    copying quickfix44.py -> build/lib.macosx-10.6-intel-3.6\n    copying quickfix50.py -> build/lib.macosx-10.6-intel-3.6\n    copying quickfix50sp1.py -> build/lib.macosx-10.6-intel-3.6\n    copying quickfix50sp2.py -> build/lib.macosx-10.6-intel-3.6\n    running build_ext\n    Testing for std::tr1::shared_ptr...\n    /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\n    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]\n    test_std_tr1_shared_ptr.cpp:1:10: fatal error: \'tr1/memory\' file not found\n    #include <tr1/memory>\n             ^~~~~~~~~~~~\n    1 warning and 1 error generated.\n     ...not found\n    Testing for std::shared_ptr...\n    /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\n    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]\n    test_std_shared_ptr.cpp:1:10: fatal error: \'memory\' file not found\n    #include <memory>\n             ^~~~~~~~\n    1 warning and 1 error generated.\n    ...not found\n    Testing for std::unique_ptr...\n    /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\n    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]\n    test_std_unique_ptr.cpp:1:10: fatal error: \'memory\' file not found\n    #include <memory>\n             ^~~~~~~~\n    1 warning and 1 error generated.\n    ...not found\n    building \'_quickfix\' extension\n    creating build/temp.macosx-10.6-intel-3.6\n    creating build/temp.macosx-10.6-intel-3.6/C++\n    /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\n    warning: unknown warning option \'-Wno-maybe-uninitialized\'; did you mean \'-Wno-uninitialized\'? [-Wunknown-warning-option]\n    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]\n    In file included from C++/DataDictionaryProvider.cpp:26:\n    In file included from C++/DataDictionaryProvider.h:29:\n    In file included from C++/DataDictionary.h:29:\n    In file included from C++/Fields.h:25:\n    In file included from C++/FixFields.h:4:\n    C++/Field.h:29:10: fatal error: \'sstream\' file not found\n    #include <sstream>\n             ^~~~~~~~~\n    2 warnings and 1 error generated.\n    error: command \'/usr/bin/clang\' failed with exit status 1\n    ----------------------------------------\nERROR: 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.\n
Run Code Online (Sandbox Code Playgroud)\n

然后我继续从源代码安装。所以我下载了zip包并运行:

\n
./bootstrap\n./configure --with-python3\nmake\n
Run Code Online (Sandbox Code Playgroud)\n

这之后产生了以下错误make

\n
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive\nMaking all in UnitTest++\nmake[2]: Nothing to be done for `all\'.\nMaking all in src\nMaking all in C++\n/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive\nMaking all in test\nmake[5]: Nothing to be done for `all\'.\nrm -rf ../../lib/libquickfix.a\nrm -rf ../../lib/libquickfix.la\nrm -rf ../../lib/libquickfix.so\nrm -rf ../../lib/libquickfix.dylib\nln -s ../src/C++/.libs/libquickfix.a ../../lib/libquickfix.a\nln -s ../src/C++/.libs/libquickfix.la ../../lib/libquickfix.la\nln -s ../src/C++/.libs/libquickfix.so ../../lib/libquickfix.so\nln -s ../src/C++/.libs/libquickfix.dylib ../../lib/libquickfix.dylib\nbash ./copy.sh ../../include/quickfix *.h\n: command not found\n: invalid option11: set: -\nset: usage: set [--abefhkmnptuvxBCHP] [-o option] [arg ...]\n: command not found \n: command not found shift\n: command not found \n\'/copy.sh: line 17: syntax error near unexpected token `do\n\'/copy.sh: line 17: `do\nmake[5]: *** [all-local] Error 2\nmake[4]: *** [all-recursive] Error 1\nmake[3]: *** [all] Error 2\nmake[2]: *** [all-recursive] Error 1\nmake[1]: *** [all-recursive] Error 1\nmake: *** [all] Error 2\n
Run Code Online (Sandbox Code Playgroud)\n

我在他们的文档中找不到任何非常非常小的内容,在 Stack Overflow 上也找不到。我知道我可以在 centos 或 ubuntu 上继续我的开发,但我真的希望它也能在 Mac 上工作。

\n