【问题标题】:Installing pip3 packages. Getting "command 'clang' failed with exit status 1"安装 pip3 包。获取“命令‘clang’失败,退出状态为 1”
【发布时间】:2018-02-21 20:01:27
【问题描述】:

我正在关注本指南: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 未安装。

【问题讨论】:

    标签: python-3.x pip leveldb


    【解决方案1】:

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

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

    我建议你通过 brew 安装 leveldb

     brew install leveldb
    

    【讨论】:

    • 我实际上检查了pip3 list,但没有看到已安装 leveldb :( 用我看到的内容更新我的问题。
    • 我认为您需要通过 brew 安装它,请参阅更新的答案
    • 谢谢!那行得通...另一个注意事项,我可以在我的工作笔记本电脑上pip3 install leveldb,错误发生在我安装了High Sierra的个人身上。
    猜你喜欢
    • 2012-05-01
    • 2017-11-28
    • 2023-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-11
    相关资源
    最近更新 更多