windows - 在 Windows 上安装 secp256k1 库时出错

标签 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,但似乎没有任何效果。

最佳答案

你可以用这个:https://github.com/jhtitor/secp256k1prp-py

来自存储库自述文件:

Windows 7+

install .NET Framework 4.6 or higher
install Visual C++ 14.0 from "Microsoft Visual C++ Build Tools"
install python 3.6.5 or later
Note: for python 3.5 builds, download and install Visual Studio 2015

然后再次尝试安装

关于windows - 在 Windows 上安装 secp256k1 库时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50406811/

相关文章:

python - 通过 "easy_install."安装时 PyOpenCL 找不到包含文件

java - 如何设置PATH同时使用Java和Python

用于确定进程工作目录的 Windows 批处理命令

git - 如何使用 pip 卸载 git repo?

python - easy_install 在 Windows XP 中出现错误 "Not a recognized archive type"

python - 为什么 easy_install 可以正确修改 Python 模块加载路径,而 pip 和 .tar.gz 源却不能?

windows - DirectX 12 "Full Screen Exclusive Windows"是否强制以与 DWM 相同的刷新率运行?

Python 原始字符串和尾部反斜杠

python - 不能用pip安装elementtree

python - 无法使用pip安装matplotlib