安装 pip3 包。获取 "command 'clang' failed with exit status 1"

Installing pip3 packages. Getting "command 'clang' failed with exit status 1"

我正在遵循此指南:https://freedomnode.com/blog/69/how-to-install-an-electrum-server-using-full-bitcoin-node-and-electrumx

目前卡在这一步,安装pip3 deps 安装所需的 Python 包

pip3 install aiohttp pylru leveldb plyvel

在 运行 该命令之后,我得到以下命令 error/warnings

1 warning generated.
   clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c leveldb/util/cache.cc -o build/temp.macosx-10.13-x86_64-3.6/leveldb/util/cache.o -I./leveldb/include -I./leveldb -I./snappy -I. -fno-builtin-memcmp -O2 -fPIC -DNDEBUG -DSNAPPY -DOS_MACOSX -DLEVELDB_PLATFORM_POSIX -Wno-error=unused-command-line-argument-hard-error-in-future
   warning: unknown warning option '-Werror=unused-command-line-argument-hard-error-in-future'; did you mean '-Werror=unused-command-line-argument'? [-Wunknown-warning-option]
   In file included from leveldb/util/cache.cc:10:
   In file included from ./leveldb/port/port.h:14:
   In file included from ./leveldb/port/port_posix.h:50:
   ./leveldb/port/atomic_pointer.h:56:3: warning: 'OSMemoryBarrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_thread_fence() from <atomic> instead [-Wdeprecated-declarations]
     OSMemoryBarrier();
     ^
   /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/libkern/OSAtomicDeprecated.h:749:9: note: 'OSMemoryBarrier' has been explicitly marked deprecated here
   void    OSMemoryBarrier( void );
           ^
   leveldb/util/cache.cc:322:14: error: allocating an object of abstract class type 'leveldb::(anonymous namespace)::ShardedLRUCache'
     return new ShardedLRUCache(capacity);
                ^
   /usr/local/include/leveldb/cache.h:94:18: note: unimplemented pure virtual method 'TotalCharge' in 'ShardedLRUCache'
     virtual size_t TotalCharge() const = 0;
                    ^
2 warnings and 1 error generated.
   error: command 'clang' failed with exit status 1

   ----------------------------------------
Command "/usr/local/opt/python3/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/mv/63xqwfld3sbc4dk63fwj7f4h0000gn/T/pip-build-5vi7gmvb/leveldb/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/mv/63xqwfld3sbc4dk63fwj7f4h0000gn/T/pip-t8d4xlfy-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/mv/63xqwfld3sbc4dk63fwj7f4h0000gn/T/pip-build-5vi7gmvb/leveldb/

执行pip3 list会显示以下内容,leveldb没有安装。

谷歌搜索错误消息找到这个 https://github.com/peercoin/peercoin/issues/234

It seems your compiling against the system installed leveldb instead of the leveldb in src directory. If possible try uninstalling leveldb from your system (if it is not needed by other applications of course).

我建议你通过 brew 安装 leveldb

 brew install leveldb