安装pip3包。获得"命令' clang'退出状态1"

时间:2018-02-21 20:01:28

标签: python-3.x pip leveldb

我遵循本指南: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

运行该命令后,我收到以下错误/警告

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未安装。

enter image description here

1 个答案:

答案 0 :(得分:2)

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

  

似乎您对系统的编译安装了leveldb而不是src目录中的leveldb。   如果可能,请尝试从系统中卸载leveldb(如果其他应用程序当然不需要)。

我建议您通过brew安装leveldb

 brew install leveldb