在Windows上安装secp256k1库时出错

时间:2018-05-18 08:17:40

标签: windows pip easy-install

我正在尝试在我的Windows 10 64位计算机上安装secp256k1库,并收到以下错误

C:\Users\user\Downloads\http-ftp>pip3 install secp256k1
Collecting secp256k1
  Using cached https://files.pythonhosted.org/packages/52/62/d7bf3829e126e517e253d2e22a63511c54bbaac34d7ddea316cde040fc49/secp256k1-0.13.2.tar.gz
Requirement already satisfied: cffi>=1.3.0 in c:\users\user\appdata\local\programs\python\python36\lib\site-packages (from secp256k1) (1.11.5)
Requirement already satisfied: pycparser in c:\users\user\appdata\local\programs\python\python36\lib\site-packages (from cffi>=1.3.0->secp256k1) (2.18)
Building wheels for collected packages: secp256k1
  Running setup.py bdist_wheel for secp256k1 ... error
  Complete output from command c:\users\user\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-ewfjmjoy\\secp256k1\\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 C:\Users\user\AppData\Local\Temp\pip-wheel-p9ijp41o --python-tag cp36:
  0.28
  Using bundled libsecp256k1
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\secp256k1
  copying secp256k1\__init__.py -> build\lib.win-amd64-3.6\secp256k1
  copying secp256k1\__main__.py -> build\lib.win-amd64-3.6\secp256k1
  running build_clib
  error: [WinError 193] %1 is not a valid Win32 application

  ----------------------------------------
  Failed building wheel for secp256k1
  Running setup.py clean for secp256k1
Failed to build secp256k1
Installing collected packages: secp256k1
  Running setup.py install for secp256k1 ... error
    Complete output from command c:\users\user\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-ewfjmjoy\\secp256k1\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\user\AppData\Local\Temp\pip-record-y6bxnsr0\install-record.txt --single-version-externally-managed --compile:
    0.28
    Using bundled libsecp256k1
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    creating build\lib.win-amd64-3.6\secp256k1
    copying secp256k1\__init__.py -> build\lib.win-amd64-3.6\secp256k1
    copying secp256k1\__main__.py -> build\lib.win-amd64-3.6\secp256k1
    running build_clib
    error: [WinError 193] %1 is not a valid Win32 application

    ----------------------------------------
Command "c:\users\user\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-ewfjmjoy\\secp256k1\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\user\AppData\Local\Temp\pip-record-y6bxnsr0\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\user\AppData\Local\Temp\pip-install-ewfjmjoy\secp256k1\

有什么建议可能是错的,如何纠正?我尝试使用pip3和easy_install,但似乎没有任何效果。

3 个答案:

答案 0 :(得分:0)

您可以使用以下一种:https://github.com/jhtitor/secp256k1prp-py

从资源库README:

{{1}}

然后尝试再次安装

答案 1 :(得分:0)

不支持Windows:https://github.com/hyperledger/sawtooth-sdk-python/blob/master/BUILD.md

”支持的操作系统:Ubuntu 18.04和macOS

如果要使用Windows系统,建议您在虚拟机管理器(例如Hyper-V或VirtualBox)中安装Ubuntu 18.04,然后从客户机操作系统进行开发。”

答案 2 :(得分:-1)

您可能想要使用此 lib https://pypi.org/project/secp256k1Crypto/

pip3 install secp256k1Crypto

它是 secp256k1-py 的一个分支(具有确切的功能),但带有来自 electrumsv-secp256k1 的预编译库,它支持 Windows,易于安装。