5

I am trying to install the secp256k1 library on my windows 10 64-bit machine and I receive the following error

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\

Any suggestions what can be wrong and how to correct it? I tried with pip3 and easy_install also but nothing seems to work.

phd
  • 82,685
  • 13
  • 120
  • 165
Cheetara
  • 165
  • 1
  • 5
  • 14

4 Answers4

2

You can use this one: https://github.com/jhtitor/secp256k1prp-py

from the repository README:

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

Then try to install it again

37dev
  • 179
  • 1
  • 3
  • 13
0

Windows is not supported: https://github.com/hyperledger/sawtooth-sdk-python/blob/master/BUILD.md

"Supported operating systems: Ubuntu 18.04 and macOS

If you want to use a Windows system, we recommend that you install Ubuntu 18.04 in a virtual machine manager, such as Hyper-V or VirtualBox, and develop from the guest operating system."

0

I had the same problem in Ubuntu and I solved it with this solution:

sudo apt-get install libsecp256k1-dev

Source

MHeidarian
  • 43
  • 10
-1

You might want to use this lib https://pypi.org/project/secp256k1Crypto/

pip3 install secp256k1Crypto

it's a fork of secp256k1-py (with the exact functionality) but with precompiled libraries from electrumsv-secp256k1 which supports Windows with easy installation.