Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issues with getting fastecdsa working in Windows

See original GitHub issue

There are some issues getting the module working in Windows - I found fixes, but they aren’t very elegant:

  • The Microsoft Visual C++ Compiler for Python 2.7 package doesn’t seem to support C99 style variables, so I had to move all variable declarations to the start of functions.
  • Don’t bother trying to get GMP working on Windows, just use MPIR instead.
  • If the MPIR library is compiled against a different runtime than fastecdsa (I used VS2015 for compiling MPIR and the previously mentioned VCC for Python 2.7 on fastecdsa), it will mysteriously crash after free()ing the buffer returned from mpz_get_str() - seems to be because memory allocators in different VC runtimes are sometimes incompatible. Changing the free to __gmp_default_free fixed this issue.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:27 (7 by maintainers)

github_iconTop GitHub Comments

naphy0commented, Jul 9, 2019

You need to have an microsoft visual 2019 and Microsoft c++ in visual studio to run the fastedcsa. You cannot install it without Microsoft c++. after that follow this instruction.

  1. Download
  2. Download
  3. rename mpir.h to gmp.h from MPIR-Binary-master\include and rename mpir.lib to gmp.lib from MPIR-Binary-master\lib\MD\x64\Release
  4. Copy and paste gmp.lib C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.21.27702\lib\x64
  5. Copy and paste gmp.h C:\Phyton3\include
  6. I don’t remember if I do this ( just put mpir.dll from MPIR-Binary-master\dll\x64\Release in to the directory of package, C:\Python37\Lib\site-packages\fastecdsa ) Do it last if you have error. if not working try to rename it again to gmp.dll But I guess it’s not needed to install fastedcsa.
  7. Open CMD and cd to where you put your fastecdsa E:\Download\fastecdsa-master
  8. when your cmd is in the directory type: python build
  9. after installation type again: python install
  10. Good Luck treasure hunting.
PaulGregorcommented, Feb 7, 2019

Here is somthing interesting - I have not directory of package, .\Lib\site-packages\fastecdsa just egg file in .\Lib\site-packages Different python build/install systems? How to check it? Also, no mpir.dll at my machine at all. Have mpir.lib at MPIR build dir copyed to VC\lib\gmp.lib Attached file is build log from scratch. But, from working machine, were exist working fastecdsa pack build.log

You can just copy fastecdsa from egg directory to site-packages. Also I dont know about python 2.7. I’ve tested on 3+ only. My steps were: copy gmp.h to C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include copy mpir.lib to package directory, it could be C:\Python37\Lib\site-packages\fastecdsa or C:\Python37\Lib\site-packages\fastecdsa-1.6.5-py3.7-win-amd64.egg\fastecdsa

Read more comments on GitHub >

github_iconTop Results From Across the Web

FASTECDSA : Module Not FoundError - Stack Overflow
As the error says, that pip modules requires Microsoft Visual C++ 14.0 or greater. error: Microsoft Visual C++ 14.0 or greater is required....
Read more >
fastecdsa - PyPI
Due to the the dependency on the GMP C library building this package on Windows is difficult and no official support or distributions...
Read more >
Installation — fastecdsa 2.2.3 documentation
h header (and links against gmp via the -lgmp flag). Installing Dependencies¶. Ubuntu / Debian¶. $ sudo apt-get install gcc python-dev libgmp3- ...
Read more >
Run your first StarkNet node — DZupp -
For any troubleshooting or more in-depth instructions on how to get Ubuntu running on your system please visit Ubuntu official tutorials ...
Read more >
How to Install Pip on Windows - ActiveState
Adding PIP to Windows Environment Variables. One of the most common problems with running Python tools like pip is the “not on PATH”...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found