iconservice包的pip3安装错误
pip3 installation error with the iconservice package
我正在尝试 $ sudo pip3 install iconservice
按照本教程中的说明进行操作:
https://medium.com/@2infiniti/creating-icon-dapp-from-a-z-part-1-tools-environment-dd56f8dfc905.
我是 运行 OS-X.
我收到以下错误消息,但我不确定发生了什么。我已经按照其他地方的指示弄乱了 cflags,但没有任何变化。
35 warnings and 4 errors generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Moving to /usr/local/lib/python3.7/site-packages/plyvel-1.1.0.dist-info/
from /usr/local/lib/python3.7/site-packages/~lyvel-1.1.0.dist-info
Moving to /usr/local/lib/python3.7/site-packages/plyvel/
from /usr/local/lib/python3.7/site-packages/~lyvel
Command "/usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-nsgaksl0/plyvel/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/tmp/pip-record-rhqla4_4/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-install-nsgaksl0/plyvel/~
iconservice
软件包 requires libsecp256k
似乎要安装到您的系统上。
Building wheel for secp256k1 (setup.py) ... error
ERROR: ...
ERROR: 0.29.1
Using bundled libsecp256k1
...
Failed to build secp256k1
对于 Linux,只需按照 Setup on Linux 步骤先安装它:
$ sudo apt-get install libleveldb1 libleveldb-dev libsecp256k1-dev
$ pip install iconservice
对于Mac OS X,它需要更多的步骤:
# install leveldb
$ brew install pkg-config automake libtool leveldb
# install libsecp256k (from source)
# based on this (https://github.com/bitcoin-core/secp256k1#build-steps)
$ git clone https://github.com/bitcoin-core/secp256k1.git
$ cd secp256k1/
$ ./autogen.sh
$ ./configure
$ make
# install plyvel
# based on this (https://github.com/wbolster/plyvel/issues/66#issuecomment-460094085)
$ mv /Applications/XCode.app /Applications/Xcode_cp.app
$ leveldb_version=$(ls /usr/local/Cellar/leveldb/ | tail -1)
$ CFLAGS="-mmacosx-version-min=10.7 -stdlib=libc++" \
pip install plyvel \
--no-cache-dir \
--global-option=build_ext \
--global-option="-I/usr/local/Cellar/leveldb/${leveldb_version}/include/" \
--global-option="-L/usr/local/lib"
$ mv /Applications/XCode_cp.app /Applications/Xcode.app
$ pip freeze | grep plyvel
plyvel==1.1.0
# download icon-service source
$ git clone https://github.com/icon-project/icon-service.git
# edit the requirements.txt included with the icon-service source
# to update the plyvel version to match what's already installed
# on your machine (from the previous step)
$ cd icon-service
$ vim requirements.txt
$ cat requirements.txt
...
plyvel==1.1.0 <-- I updated this from 1.0.5
...
# build and install iconservice from wheels
$ ./build.sh
$ CFLAGS="-mmacosx-version-min=10.7 -stdlib=libc++" \
pip install dist/iconservice-1.3.0-py3-none-any.whl \
--no-cache-dir \
--global-option=build_ext \
--global-option="-I/usr/local/Cellar/leveldb/${leveldb_version}/include/" \
--global-option="-L/usr/local/lib"
请注意,我从源代码安装了 iconservice
,因为 pip install iconservice
仍然失败(我认为轮子没有为 Mac OS X 正确构建)。然后我还从 iconservice
源更新了 requirements.txt 文件中的 plyvel
版本,因为从 wheel 安装它需要 1.0.5 版本但我已经在 1.1.0 中使用了 plyvel(我不知道这是否会对包的行为产生影响......)。
附带说明一下,如果您已经在使用虚拟环境,则不应再将 sudo
与 pip install
一起使用。使用 virtualenv 的目的是避免 "dirtying" 系统包,如果你使用 sudo
它有点违背 virtualenv 的目的。
我正在尝试 $ sudo pip3 install iconservice
按照本教程中的说明进行操作:
https://medium.com/@2infiniti/creating-icon-dapp-from-a-z-part-1-tools-environment-dd56f8dfc905.
我是 运行 OS-X.
我收到以下错误消息,但我不确定发生了什么。我已经按照其他地方的指示弄乱了 cflags,但没有任何变化。
35 warnings and 4 errors generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Moving to /usr/local/lib/python3.7/site-packages/plyvel-1.1.0.dist-info/
from /usr/local/lib/python3.7/site-packages/~lyvel-1.1.0.dist-info
Moving to /usr/local/lib/python3.7/site-packages/plyvel/
from /usr/local/lib/python3.7/site-packages/~lyvel
Command "/usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-nsgaksl0/plyvel/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/tmp/pip-record-rhqla4_4/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-install-nsgaksl0/plyvel/~
iconservice
软件包 requires libsecp256k
似乎要安装到您的系统上。
Building wheel for secp256k1 (setup.py) ... error
ERROR: ...
ERROR: 0.29.1
Using bundled libsecp256k1
...
Failed to build secp256k1
对于 Linux,只需按照 Setup on Linux 步骤先安装它:
$ sudo apt-get install libleveldb1 libleveldb-dev libsecp256k1-dev
$ pip install iconservice
对于Mac OS X,它需要更多的步骤:
# install leveldb
$ brew install pkg-config automake libtool leveldb
# install libsecp256k (from source)
# based on this (https://github.com/bitcoin-core/secp256k1#build-steps)
$ git clone https://github.com/bitcoin-core/secp256k1.git
$ cd secp256k1/
$ ./autogen.sh
$ ./configure
$ make
# install plyvel
# based on this (https://github.com/wbolster/plyvel/issues/66#issuecomment-460094085)
$ mv /Applications/XCode.app /Applications/Xcode_cp.app
$ leveldb_version=$(ls /usr/local/Cellar/leveldb/ | tail -1)
$ CFLAGS="-mmacosx-version-min=10.7 -stdlib=libc++" \
pip install plyvel \
--no-cache-dir \
--global-option=build_ext \
--global-option="-I/usr/local/Cellar/leveldb/${leveldb_version}/include/" \
--global-option="-L/usr/local/lib"
$ mv /Applications/XCode_cp.app /Applications/Xcode.app
$ pip freeze | grep plyvel
plyvel==1.1.0
# download icon-service source
$ git clone https://github.com/icon-project/icon-service.git
# edit the requirements.txt included with the icon-service source
# to update the plyvel version to match what's already installed
# on your machine (from the previous step)
$ cd icon-service
$ vim requirements.txt
$ cat requirements.txt
...
plyvel==1.1.0 <-- I updated this from 1.0.5
...
# build and install iconservice from wheels
$ ./build.sh
$ CFLAGS="-mmacosx-version-min=10.7 -stdlib=libc++" \
pip install dist/iconservice-1.3.0-py3-none-any.whl \
--no-cache-dir \
--global-option=build_ext \
--global-option="-I/usr/local/Cellar/leveldb/${leveldb_version}/include/" \
--global-option="-L/usr/local/lib"
请注意,我从源代码安装了 iconservice
,因为 pip install iconservice
仍然失败(我认为轮子没有为 Mac OS X 正确构建)。然后我还从 iconservice
源更新了 requirements.txt 文件中的 plyvel
版本,因为从 wheel 安装它需要 1.0.5 版本但我已经在 1.1.0 中使用了 plyvel(我不知道这是否会对包的行为产生影响......)。
附带说明一下,如果您已经在使用虚拟环境,则不应再将 sudo
与 pip install
一起使用。使用 virtualenv 的目的是避免 "dirtying" 系统包,如果你使用 sudo
它有点违背 virtualenv 的目的。