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

问题描述 投票:0回答:1

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

上的说明进行操作

Centos/Ubuntu 上的安装与

pip3.6 install quickfix
完美配合;但是我在 MacOSX Mojave 10.14 上不断收到错误

首先我运行

xcode-select --install
来安装命令行工具,然后我
brew install gcc

最后我执行了

pip3 install quickfix
。该命令一直失败,并出现很长的错误日志,如下所示:

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.

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

./bootstrap
./configure --with-python3
make

这在

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

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

python macos installation quickfix fix-protocol
1个回答
0
投票

你能解决这个问题吗?几天来我一直面临同样的问题,这让我发疯。非常感谢任何建议!

© www.soinside.com 2019 - 2024. All rights reserved.