I ran all of the installation instructions in the development version’s README, but I got this error.
I have bitcoin core v0.18 installed, so shouldn’t I have libsecp256k1 installed?
(venv) zach@zach-desktop ~/electrum/electrum $ python3.6 run_electrum
Traceback (most recent call last):
File "run_electrum", line 80, in <module>
from electrum.logging import get_logger, configure_logging
File "/home/zach/electrum/electrum/electrum/__init__.py", line 3, in <module>
from .wallet import Wallet
File "/home/zach/electrum/electrum/electrum/wallet.py", line 50, in <module>
from .simple_config import get_config
File "/home/zach/electrum/electrum/electrum/simple_config.py", line 13, in <module>
from . import constants
File "/home/zach/electrum/electrum/electrum/constants.py", line 30, in <module>
from . import bitcoin
File "/home/zach/electrum/electrum/electrum/bitcoin.py", line 34, in <module>
from . import ecc
File "/home/zach/electrum/electrum/electrum/ecc.py", line 45, in <module>
do_monkey_patching_of_python_ecdsa_internals_with_libsecp256k1()
File "/home/zach/electrum/electrum/electrum/ecc_fast.py", line 189, in do_monkey_patching_of_python_ecdsa_internals_with_libsecp256k1
raise Exception('libsecp256k1 library not available. '
Exception: libsecp256k1 library not available. Verifying Lightning channels is too computationally expensive without libsecp256k1, aborting.
Comments
Tested on Feb10 Build to the Latest Build.
OS: Windows10
Python versions: 3.6.1 and 3.8
All other dependencies are installed
When trying to run Electrum:
C:PythonPython361>python electrum-master/run_electrum
E | ecc_fast | libsecp256k1 library failed to load
Error: Failed to load libsecp256k1.
libsecp256k1 was installed through:
C:PythonPython361>python -m pip install libsecp256k1
Requirement already satisfied: libsecp256k1 in c:pythonpython361libsite-packages (0.1)
In comparison, the dev build copy that I have downloaded last February 5 is working despite not having libsecp256k1.
It’s just crashing when I’m trying to enable lightning due to obvious reasons.
This might be caused by this PR: #5947
«make libsecp256k1 a mandatory dependency«
nc50lc
changed the title
Lastest Electrum 4.0.0a0 build wont launch on Python
Latest Electrum 4.0.0a0 build wont launch on Python
Feb 21, 2020
SomberNight
changed the title
Latest Electrum 4.0.0a0 build wont launch on Python
How to get libsecp256k1 when running from source on Windows?
Feb 21, 2020
Like the README says, libsecp256k1 is a non-python dependency; you should not install it via pip.
libsecp256k1 was installed through:
C:PythonPython361>python -m pip install libsecp256k1
Requirement already satisfied: libsecp256k1 in c:pythonpython361libsite-packages (0.1)
This package you installed is named libsecp256k1 but it is virtually empty. Someone is probably just namesquatting it.
What you will need is a dll, named libsecp256k1-0.dll
, e.g. placed into the inner «electrum» folder.
As the README says, we provide a script to build this yourself when running from source, contrib/make_libsecp256k1.sh
, however atm this script only works on Unix-like systems (Linux/Mac).
Our own build script for the Windows binaries is cross-compiling from Linux to Windows.
If you have access to a Linux machine (e.g. VM) or perhaps even using WSL (Windows Subsystem for Linux), you can cross-compile from there to Windows this dll.
Whether you need a 32 bit or a 64 bit binary depends on the Python interpreter you have installed.
To compile a 32 bit (x86) dll, run:
GCC_TRIPLET_HOST="i686-w64-mingw32" ./contrib/make_libsecp256k1.sh
To compile a 64 bit (x86_64, amd64) dll, run:
GCC_TRIPLET_HOST="x86_64-w64-mingw32" ./contrib/make_libsecp256k1.sh
I guess this should be made easier… We weren’t/aren’t sure how many people there are running from source on Windows.
Copy link
Contributor
Author
Thanks! I’ll try it later.
But I guess I can close this issue now.
I can’t seem to get this to work either… I compiled libsecp256k1 using the .sh in the contrib folder as advised and then copied the .dll and the .so that it generated to my Windows box…
Still getting:
E | ecc_fast | libsecp256k1 library failed to load
Error: Failed to load libsecp256k1.
After hacking in some debug into ecc_fast.py
E | ecc_fast | LibPath: E:electrum-masterelectrumlibsecp256k1-0.dll
WARNING: [WinError 193] %1 is not a valid Win32 application
E | ecc_fast | LibPath: libsecp256k1-0.dll
WARNING: [WinError 193] %1 is not a valid Win32 application
Seems the .dll being produced isn’t correct? ???
@HardCorePawn
[WinError 193] %1 is not a valid Win32 application
I get that exception if the dll is for the wrong architecture (32 vs 64 bit).
Let’s keep this issue open, as the current workaround is not ideal.
Turns out that:
sudo apt-get install gcc-mingw-w64
Is a «good idea»™ if you’re building this outside of the build-wine docker «fresh_clone» thing
Not sure why it didn’t complain and still produced a .dll file earlier? Anyway, it seems to have produced a «proper» x64 bit .dll file now
22/02/2020 08:45 743,971 libsecp256k1-0.dll
And with that copied over to the Windows 10 box and put in the /electrum-master/electrum directory, Electrum is starting up OK when running from source
sidhujag
pushed a commit
to syscoin/electrumsys
that referenced
this issue
Mar 29, 2020
Download the raw nupkg file from https://www.nuget.org/packages/Secp256k1.Net (use «Download package» link in «Info» section on the right), unzip the file, extract libsecp256k1.dll
from runtimeswin-x86native
or runtimeswin-x64native
, place it as libsecp256k1-0.dll
in the electrum project folder.
On my station from my MINGW64 shell on Windows 10
pacman -S git python-pip base-devel mingw-w64-x86_64-toolchain
pacman -S mingw-w64-x86_64-python-pyqt5 mingw-w64-x86_64-python-cryptography
git clone https://github.com/spesmilo/electrum.git
cd electrum
git checkout tags/4.0.0b0 -b 4.0.0.tmp
GCC_TRIPLET_HOST="x86_64-w64-mingw32" ./contrib/make_libsecp256k1.sh
cp /mingw64/bin/libgmp-10.dll electrum
python -m venv --system-site-packages .venv
source .venv/bin/activate
.venv/bin/python -m pip install --upgrade setuptools
.venv/bin/python -m pip install --upgrade pip
.venv/bin/python -m pip install -e .[full]
.venv/bin/python run_electrum
Everything worked fine. Verified with a Trezor-1
I’ve built a 64-bit DLL for people — that trust me — to use.
libsecp256k1-0.zip
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
I've built this libsecp256k1-0.dll now, for 64-bit python.
The build should be reproducible.
$ sha256sum electrum/libsecp256k1-0.dll
9e719c3ccaa946f08983f148b5880527ed6fcab718b1502cb916b52a9380a1e9 electrum/libsecp256k1-0.dll
Details:
$ GCC_STRIP_BINARIES="1" GCC_TRIPLET_HOST="x86_64-w64-mingw32" ./contrib/make_libsecp256k1.sh
$ git log -n 1
commit b7cc5f329c7d85f416cc35af00d11fe93c74ec09 (HEAD -> master, spesmilo/master, spesmilo/HEAD)
https://github.com/spesmilo/electrum/blob/b7cc5f329c7d85f416cc35af00d11fe93c74ec09/contrib/make_libsecp256k1.sh
LIBSECP_VERSION="dbd41db16a0e91b2566820898a3ab2d7dad4fe00"
ghost43
2021-07-12
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEEbXohFtqQngCsIRCLsztfIyxicekFAmDsUwMACgkQsztfIyxi
cekCMA//clofhfhKZ4d0eWcAVm8ESe4VJApn5SshcmAcpnofFRKqHN47UxFqfyX+
18N6RVXm6Pk5ivPlAduVGqESWRCQfz5THNok8vYhJyAcFnbTJw7m4A5qn0+f19U/
zQ1qQFiEAhjottnQEfjc6Dk+ffcl6HgFtyqkDczm5xuiV9e2mdLeRUeC1OCUtHLr
lMUCil/O0BFEYJmkrZ0tW0pEdm8Qgk3cWlOox+kTq7HAcLp7jimwIPippTnRPGzn
cMg7eVrMAuB1fv8AVhNp/Sq+PStuSxisfTtZuSR9lVnMFqLqZsxHAFasvuYDup2v
C5jaLo6jCRjlzWblqfOB1v5g+wR0iruwVpwsTZyFg7am7jw/XwBQkWVmz86tUq0l
z4wYK8m2tmc977KWTXJ5bzCoUwKCyQ9xHkD4ohGLp72y+PUKJUN6PtuuzHwanHQD
MgxBiOR1j2bqzm5lgar13JVFIQKssEBuyCiR6CVpfiYzBBiXZiig2alrryIjOkTP
mgzNK+XNEM4rthyHGMT/qaLk1+8UyPuHqhEEnIAOJo7K1R4QtE8efOaot13f1JD4
tOMsQLuiX08plvzbV6gQFQLIoxyi75GPzpJrlTjI97MVzw4DvRq+/kp/ELYQkOoL
KG+w9PzSPFWV8arTr1futQOaLf6nSdgNLwVscuoB447yBwUzDgk=
=8aWU
-----END PGP SIGNATURE-----
Like the README says, libsecp256k1 is a non-python dependency; you should not install it via pip.
libsecp256k1 was installed through:
C:PythonPython361>python -m pip install libsecp256k1
Requirement already satisfied: libsecp256k1 in c:pythonpython361libsite-packages (0.1)This package you installed is named libsecp256k1 but it is virtually empty. Someone is probably just namesquatting it.
What you will need is a dll, named
libsecp256k1-0.dll
, e.g. placed into the inner «electrum» folder.
As the README says, we provide a script to build this yourself when running from source,contrib/make_libsecp256k1.sh
, however atm this script only works on Unix-like systems (Linux/Mac).Our own build script for the Windows binaries is cross-compiling from Linux to Windows.
If you have access to a Linux machine (e.g. VM) or perhaps even using WSL (Windows Subsystem for Linux), you can cross-compile from there to Windows this dll.Whether you need a 32 bit or a 64 bit binary depends on the Python interpreter you have installed.
To compile a 32 bit (x86) dll, run:GCC_TRIPLET_HOST="i686-w64-mingw32" ./contrib/make_libsecp256k1.sh
To compile a 64 bit (x86_64, amd64) dll, run:
GCC_TRIPLET_HOST="x86_64-w64-mingw32" ./contrib/make_libsecp256k1.sh
I guess this should be made easier… We weren’t/aren’t sure how many people there are running from source on Windows.
after doing this command through WSL I get the error «collect2: error: ld returned 1 exit status
make: *** [Makefile:910: libsecp256k1.la] Error 1
🗯 ERROR: Could not build secp256k1″
Like the README says, libsecp256k1 is a non-python dependency; you should not install it via pip.
libsecp256k1 was installed through:
C:PythonPython361>python -m pip install libsecp256k1
Requirement already satisfied: libsecp256k1 in c:pythonpython361libsite-packages (0.1)This package you installed is named libsecp256k1 but it is virtually empty. Someone is probably just namesquatting it.
What you will need is a dll, namedlibsecp256k1-0.dll
, e.g. placed into the inner «electrum» folder.
As the README says, we provide a script to build this yourself when running from source,contrib/make_libsecp256k1.sh
, however atm this script only works on Unix-like systems (Linux/Mac).
Our own build script for the Windows binaries is cross-compiling from Linux to Windows.
If you have access to a Linux machine (e.g. VM) or perhaps even using WSL (Windows Subsystem for Linux), you can cross-compile from there to Windows this dll.
Whether you need a 32 bit or a 64 bit binary depends on the Python interpreter you have installed.
To compile a 32 bit (x86) dll, run:GCC_TRIPLET_HOST="i686-w64-mingw32" ./contrib/make_libsecp256k1.sh
To compile a 64 bit (x86_64, amd64) dll, run:
GCC_TRIPLET_HOST="x86_64-w64-mingw32" ./contrib/make_libsecp256k1.sh
I guess this should be made easier… We weren’t/aren’t sure how many people there are running from source on Windows.
after doing this command through WSL I get the error «collect2: error: ld returned 1 exit status
make: *** [Makefile:910: libsecp256k1.la] Error 1
🗯 ERROR: Could not build secp256k1″
I made it work
thank you all
Note: I’ve added a «Running Electrum from source on Windows» guide now in 941db42. It is building on brianddk’s comment (#5976 (comment)) using MSYS2.
I followed this the MSYS2 method and the .dll was made no problem but when I get to the final step I get this error:
python3 ./run_electrum
Error: No module named ‘dns’. Try ‘sudo python3 -m pip install ‘
try python3 -m pip install dnspython
I followed this the MSYS2 method and the .dll was made no problem but when I get to the final step I get this error:
python3 ./run_electrum Error: No module named ‘dns’. Try ‘sudo python3 -m pip install ‘
The dependencies should have been installed as part of step 1:
Run install (this should install most dependencies):
> python3 -m pip install --user -e ".[gui,crypto]"
Try running electrum in the original shell you used for those steps, e.g. powershell/cmd/»windows terminal», instead of msys2 (which is used solely for building libsecp).
Не получается запустить биткойн-кошелек Electrum
От сюда
https://electrum.org/#download
и отсюда
https://askubuntu.ru/questions/182702/kak-ustanovit-bitkojn-koshelek-electrum
почитал как установить кошелек Electrum, выполнил
# apt-get install libsecp256k1_0
все поставилось, все норм! Но когда пытаюсь его запустить то он ругается
$ wget https://download.electrum.org/4.0.9/Electrum-4.0.9.tar.gz.asc
$ wget https://download.electrum.org/4.0.9/Electrum-4.0.9.tar.gz
$ pip install Electrum-4.0.9.tar.gz
$ electrum
E | ecc_fast | failed to load libsecp256k1: LibModuleMissing('libsecp256k1 library found but it was built without required module (--enable-module-recovery)')
Error: Failed to load libsecp256k1.
Что не хватает для счастья? Как мне запустить этот кошелек на Альт P9?
Записан
apt-get install libsecp256k1-devel
Записан
Андрей Черепанов (cas@)
Этот пакет уже оказывается был установлен. Не полгечало ((
# apt-get install libsecp256k1-devel
Чтение списков пакетов... Завершено
Построение дерева зависимостей... Завершено
Последняя версия libsecp256k1-devel уже установлена.
0 будет обновлено, 0 новых установлено, 0 пакетов будет удалено и 175 не будет обновлено.
$ electrum
E | ecc_fast | failed to load libsecp256k1: LibModuleMissing('libsecp256k1 library found but it was built without required module (--enable-module-recovery)')
Error: Failed to load libsecp256k1.
Записан
Этот пакет уже оказывается был установлен. Не полгечало ((
# apt-get install libsecp256k1-devel
Чтение списков пакетов... Завершено
Построение дерева зависимостей... Завершено
Последняя версия libsecp256k1-devel уже установлена.
0 будет обновлено, 0 новых установлено, 0 пакетов будет удалено и 175 не будет обновлено.
$ electrum
E | ecc_fast | failed to load libsecp256k1: LibModuleMissing('libsecp256k1 library found but it was built without required module (--enable-module-recovery)')
Error: Failed to load libsecp256k1.
Надо писать разработчикам этого программного обеспечения.
Записан
Андрей Черепанов (cas@)
Edit: Resolved. New guide reflects changes. Thanks waxwing! https://github.com/JoinMarket-Org/joinmarket/wiki/Installing-JoinMarket-on-Windows
I am having some trouble getting secp256k1 to work with joinmarket on windows 10. I did the pip install secp256k1-transient as it says in the guide and it appears to install correctly. When I run wallet-tools.py, it says that I’m not using the binding to libsecp256k1. I should be able to run secp256k1 in command prompt with python right? When I try, python -m secp256k1 I get this traceback:
Traceback (most recent call last):
File "C:Python27librunpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:Python27librunpy.py", line 72, in _run_code
exec code in run_globals
File "C:Python27libsite-packagessecp256k1.py", line 5, in <module>
from _libsecp256k1 import ffi, lib
ImportError: DLL load failed: The specified module could not be found.
It’s my impression that pip install should correctly setup libsecp256k1 but I am not seeing it anywhere on my computer. It seems to me that pip isn’t correctly installing libsecp256k1. Not sure what I’m doing wrong. I appreciate any help. Thanks!
Description
Jesús Abelardo Saldívar Aguilar
2020-08-04 16:52:51 UTC
Description of problem: I have installed the Electrum Bitcoin Wallet, but i can't run it because libsecp256k1 was built whitout required module (--enable-module-recovery) Version-Release number of selected component (if applicable): 0.20.9-2.fc32 How reproducible: Install Electrum Bitcoin Wallet from Python sources following the instructions on https://electrum.org/#download Trying to run Electrum Steps to Reproduce: 1. Download Electrum python sources from: https://download.electrum.org/4.0.2/Electrum-4.0.2.tar.gz 2. Install it with PIP: pip install --user Electrum-4.0.2.tar.gz 3. Try tu run Electrum Actual results: It fails, showing this error message: E | ecc_fast | failed to load libsecp256k1: LibModuleMissing('libsecp256k1 library found but it was built without required module (--enable-module-recovery)') Error: Failed to load libsecp256k1. Expected results: Electrum Wallet running ok. Additional info:
#haskell #bitcoin #cabal #haskell-stack #secp256k1
Вопрос:
Я перепробовал, казалось бы, бесконечное количество способов stack build
обращения к библиотеке secp256k1-haskell
, но безрезультатно.
Вот мое .cabal
досье —
cabal-version: >=1.10
name: testproj
version: 0.1.0.0
license: BSD3
license-file: LICENSE
author: XXXX
maintainer: XXXX@gmail.com
build-type: Simple
extra-source-files: CHANGELOG.md
library
exposed-modules: Addr
build-depends: base
, secp256k1-haskell
hs-source-dirs: src
default-language: Haskell2010
Я нахожусь в среде Windows, и мне удалось получить версию libsecp256k1.dll
из .net
пакета Nuget. Я попытался добавить в свой .cabal
файл следующие строки также безрезультатно —
extra-lib-dirs: lib
extra-libraries: libsecp256k1
В надежде на какую-нибудь помощь. Спасибо — я потратил сегодня безбожно много времени, пытаясь заставить это работать.
Вот результат сборки —
# stack build
secp256k1-haskell> configure
secp256k1-haskell> Configuring secp256k1-haskell-0.5.0...
secp256k1-haskell> Cabal-simple_Z6RU0evB_3.2.1.0_ghc-8.10.4.exe: The pkg-config package
secp256k1-haskell> 'libsecp256k1' is required but it could not be found.
secp256k1-haskell>
Progress 1/2
-- While building package secp256k1-haskell-0.5.0 (scroll up to its section to see the error) using:
C:srsetup-exe-cachex86_64-windowsCabal-simple_Z6RU0evB_3.2.1.0_ghc-8.10.4.exe --builddir=.stack-workdist274b403a configure --user --package-db=clear --package-db=global --package-db=C:srsnapshotscae65304pkgdb --libdir=C:srsnapshotscae65304lib --bindir=C:srsnapshotscae65304bin --datadir=C:srsnapshotscae65304share --libexecdir=C:srsnapshotscae65304libexec --sysconfdir=C:srsnapshotscae65304etc --docdir=C:srsnapshotscae65304docsecp256k1-haskell-0.5.0 --htmldir=C:srsnapshotscae65304docsecp256k1-haskell-0.5.0 --haddockdir=C:srsnapshotscae65304docsecp256k1-haskell-0.5.0 --dependency=QuickCheck=QuickCheck-2.14.2-88oxj61ONgG1QbYzt1cUFu --dependency=base=base-4.14.1.0 --dependency=base16-bytestring=base16-bytestring-0.1.1.7-ATNpmQnyL4kEoV4zknoOaT --dependency=bytestring=bytestring-0.10.12.0 --dependency=cereal=cereal-0.5.8.1-22Ay1xouyZe6jvGIwilboJ --dependency=deepseq=deepseq-1.4.4.0 --dependency=entropy=entropy-0.4.1.6-7IAXxZCKwXr4yX0UquKkIf --dependency=hashable=hashable-1.3.0.0-K3FFBNAmsvaIvBv4Qg15rQ --dependency=string-conversions=string-conversions-0.4.0.1-8DWCo9Xs3pABRiarhAOqbn --dependency=unliftio-core=unliftio-core-0.2.0.1-9GVcmaajsglG88oErAZOTV --extra-include-dirs=C:UsersdifelAppDataLocalProgramsstackx86_64-windowsmsys2-20200903mingw64include --extra-lib-dirs=C:UsersdifelAppDataLocalProgramsstackx86_64-windowsmsys2-20200903mingw64lib --extra-lib-dirs=C:UsersdifelAppDataLocalProgramsstackx86_64-windowsmsys2-20200903mingw64bin --exact-configuration --ghc-option=-fhide-source-paths
Process exited with code: ExitFailure 1
Комментарии:
1. вы вставили его
.dll
в одну из дополнительных библиотек? (не уверен, но я не вижу в местныхlib
упомянул) — кроме того, я не уверен на 100% об этом, но я думаю, что это «необходимо, но не может быть найден» — это не про ДЛЛ это про Дев файлов (c заголовочные файлы и, возможно, некоторые другие) — вы получите больше, чем то.dll
, где вы нашли файл?2. может быть, некоторые из шагов здесь: github.com/spesmilo/electrum/issues/5976 вам тоже поможет (?)
Ответ №1:
Не совсем исправление, но в конце концов я решил просто установить libsecp256k1
WSL2
и разработать оттуда. Обнаружил, что среда гораздо более удобна для пользователя и проста в настройке, чем при попытке выбрать разработку в Windows.
can’t find libsecp256k1 library error #5606
Comments
bloctavius commented Sep 2, 2019
I ran all of the installation instructions in the development version’s README, but I got this error.
I have bitcoin core v0.18 installed, so shouldn’t I have libsecp256k1 installed?
The text was updated successfully, but these errors were encountered:
willcl-ark commented Sep 3, 2019
I just encountered this also. To make it work, I had to install as per these instructions:
SomberNight commented Sep 3, 2019
Note: since merging the lightning branch, libsecp256k1 became a mandatory dependency (was optional before). The README was not updated since.
- We need to decide whether we want libsecp256k1 to be mandatory; or test whether lightning is enabled and only hard fail then.
- The README should be updated
- tar.gz source distributables also need to be considered
bloctavius commented Sep 5, 2019
Thanks! It’s working now.
bloctavius commented Sep 5, 2019
Oh, I should probably leave this open.
SomberNight commented Sep 6, 2019 •
or test whether lightning is enabled and only hard fail then.
Did this in 251db63 for now
Longer term we could/should make libsecp256k1 mandatory. Still unsure. so keeping this issue open.
ecdsa commented Sep 6, 2019
yes let’s make it mandatory
ecdsa commented Nov 23, 2019
it would be possible to list it as a python dependency, see https://github.com/electrumsv/electrumsv-secp256k1
cool007zqw commented Dec 13, 2019
a lazy solution will be:
Tectract commented Jan 12, 2020
build / run fails because of this. It should be mentioned in the readme, or fixed internally to drag this lib in during install.
Tectract commented Jan 12, 2020 •
since merging the lightning branch, libsecp256k1 became a mandatory dependency
Can we get the option to build without lightning? Have no interest in using that, ever.
SomberNight commented Jan 12, 2020
Can we get the option to build without lightning? Have no interest in using that, ever.
What exactly do you mean?
Lightning is not enabled by default.
The topic of this thread is whether to make libsecp256k1 a mandatory dependency.
Lightning is related in that libsecp256k1 is definitely needed if Lightning is enabled.
However, completely irrespective of that, there are reasons it might make sense to always require libsecp256k1.
Tectract commented Jan 12, 2020
Hmmmmmmm, I’m running into an error here:
I don’t know how to bypass it. I have installed libsecp256k1 on my system. libsecp256k1.s.0 is in /usr/local/lib.
I can’t run the new version from a clean build. What do I do?
SomberNight commented Jan 12, 2020
I don’t know how to bypass it. I have installed libsecp256k1 on my system. libsecp256k1.s.0 is in /usr/local/lib.
I can’t run the new version from a clean build. What do I do?
SomberNight commented Sep 20, 2020
The package should run straight away out of the box without the need for any dependencies and there should be no exceptions to this.
@Thecreator1 If you use the AppImage (or Mac/Windows binaries), there are no dependencies. It is self-contained.
If you use the source tarball, it only contains python sources. It does not contain the non-pure-python dependencies.
If you want to run from source, as the README says, you have to provide the missing parts yourself. (mainly libsecp256k1 , cryptography , and pyqt5 )
Источник
How to get libsecp256k1 when running from source on Windows? #5976
Comments
nc50lc commented Feb 21, 2020 •
Tested on Feb10 Build to the Latest Build.
OS: Windows10
Python versions: 3.6.1 and 3.8
All other dependencies are installed
When trying to run Electrum:
C:PythonPython361>python electrum-master/run_electrum
E | ecc_fast | libsecp256k1 library failed to load
Error: Failed to load libsecp256k1.
libsecp256k1 was installed through:
C:PythonPython361>python -m pip install libsecp256k1
Requirement already satisfied: libsecp256k1 in c:pythonpython361libsite-packages (0.1)
In comparison, the dev build copy that I have downloaded last February 5 is working despite not having libsecp256k1.
It’s just crashing when I’m trying to enable lightning due to obvious reasons.
This might be caused by this PR: #5947
«make libsecp256k1 a mandatory dependency«
The text was updated successfully, but these errors were encountered:
SomberNight commented Feb 21, 2020
Like the README says, libsecp256k1 is a non-python dependency; you should not install it via pip.
libsecp256k1 was installed through:
C:PythonPython361>python -m pip install libsecp256k1
Requirement already satisfied: libsecp256k1 in c:pythonpython361libsite-packages (0.1)
This package you installed is named libsecp256k1 but it is virtually empty. Someone is probably just namesquatting it.
What you will need is a dll, named libsecp256k1-0.dll , e.g. placed into the inner «electrum» folder.
As the README says, we provide a script to build this yourself when running from source, contrib/make_libsecp256k1.sh , however atm this script only works on Unix-like systems (Linux/Mac).
Our own build script for the Windows binaries is cross-compiling from Linux to Windows.
If you have access to a Linux machine (e.g. VM) or perhaps even using WSL (Windows Subsystem for Linux), you can cross-compile from there to Windows this dll.
Whether you need a 32 bit or a 64 bit binary depends on the Python interpreter you have installed.
To compile a 32 bit (x86) dll, run:
To compile a 64 bit (x86_64, amd64) dll, run:
I guess this should be made easier. We weren’t/aren’t sure how many people there are running from source on Windows.
nc50lc commented Feb 21, 2020
Thanks! I’ll try it later.
But I guess I can close this issue now.
HardCorePawn commented Feb 21, 2020 •
I can’t seem to get this to work either. I compiled libsecp256k1 using the .sh in the contrib folder as advised and then copied the .dll and the .so that it generated to my Windows box.
E | ecc_fast | libsecp256k1 library failed to load
Error: Failed to load libsecp256k1.
After hacking in some debug into ecc_fast.py
E | ecc_fast | LibPath: E:electrum-masterelectrumlibsecp256k1-0.dll
WARNING: [WinError 193] %1 is not a valid Win32 application
E | ecc_fast | LibPath: libsecp256k1-0.dll
WARNING: [WinError 193] %1 is not a valid Win32 application
Seems the .dll being produced isn’t correct? .
SomberNight commented Feb 21, 2020
[WinError 193] %1 is not a valid Win32 application
I get that exception if the dll is for the wrong architecture (32 vs 64 bit).
Let’s keep this issue open, as the current workaround is not ideal.
HardCorePawn commented Feb 21, 2020 •
Turns out that:
sudo apt-get install gcc-mingw-w64
Is a «good idea»™ if you’re building this outside of the build-wine docker «fresh_clone» thing 😉
Not sure why it didn’t complain and still produced a .dll file earlier? Anyway, it seems to have produced a «proper» x64 bit .dll file now
22/02/2020 08:45 743,971 libsecp256k1-0.dll
And with that copied over to the Windows 10 box and put in the /electrum-master/electrum directory, Electrum is starting up OK when running from source
boskowski commented May 19, 2020
Download the raw nupkg file from https://www.nuget.org/packages/Secp256k1.Net (use «Download package» link in «Info» section on the right), unzip the file, extract libsecp256k1.dll from runtimeswin-x86native or runtimeswin-x64native , place it as libsecp256k1-0.dll in the electrum project folder.
brianddk commented Jun 24, 2020
On my station from my MINGW64 shell on Windows 10
Everything worked fine. Verified with a Trezor-1
SomberNight commented Jul 12, 2021
I’ve built a 64-bit DLL for people — that trust me — to use.
libsecp256k1-0.zip
Stanislav-Povolotsky commented Aug 28, 2021
I was able to build libsecp256k1-0.dll following your advices.
Now you can easily build your own libsecp256k1-0.dll (x86 and x64) using docker and
https://github.com/Stanislav-Povolotsky/electrum-libsecp256k1-0.dll-builder
developeroka commented Sep 19, 2021
Like the README says, libsecp256k1 is a non-python dependency; you should not install it via pip.
libsecp256k1 was installed through:
C:PythonPython361>python -m pip install libsecp256k1
Requirement already satisfied: libsecp256k1 in c:pythonpython361libsite-packages (0.1)
This package you installed is named libsecp256k1 but it is virtually empty. Someone is probably just namesquatting it.
What you will need is a dll, named libsecp256k1-0.dll , e.g. placed into the inner «electrum» folder.
As the README says, we provide a script to build this yourself when running from source, contrib/make_libsecp256k1.sh , however atm this script only works on Unix-like systems (Linux/Mac).
Our own build script for the Windows binaries is cross-compiling from Linux to Windows.
If you have access to a Linux machine (e.g. VM) or perhaps even using WSL (Windows Subsystem for Linux), you can cross-compile from there to Windows this dll.
Whether you need a 32 bit or a 64 bit binary depends on the Python interpreter you have installed.
To compile a 32 bit (x86) dll, run:
To compile a 64 bit (x86_64, amd64) dll, run:
I guess this should be made easier. We weren’t/aren’t sure how many people there are running from source on Windows.
after doing this command through WSL I get the error «collect2: error: ld returned 1 exit status
make: *** [Makefile:910: libsecp256k1.la] Error 1
🗯 ERROR: Could not build secp256k1″
developeroka commented Sep 19, 2021
Like the README says, libsecp256k1 is a non-python dependency; you should not install it via pip.
libsecp256k1 was installed through:
C:PythonPython361>python -m pip install libsecp256k1
Requirement already satisfied: libsecp256k1 in c:pythonpython361libsite-packages (0.1)
This package you installed is named libsecp256k1 but it is virtually empty. Someone is probably just namesquatting it.
What you will need is a dll, named libsecp256k1-0.dll , e.g. placed into the inner «electrum» folder.
As the README says, we provide a script to build this yourself when running from source, contrib/make_libsecp256k1.sh , however atm this script only works on Unix-like systems (Linux/Mac).
Our own build script for the Windows binaries is cross-compiling from Linux to Windows.
If you have access to a Linux machine (e.g. VM) or perhaps even using WSL (Windows Subsystem for Linux), you can cross-compile from there to Windows this dll.
Whether you need a 32 bit or a 64 bit binary depends on the Python interpreter you have installed.
To compile a 32 bit (x86) dll, run:
To compile a 64 bit (x86_64, amd64) dll, run:
I guess this should be made easier. We weren’t/aren’t sure how many people there are running from source on Windows.
after doing this command through WSL I get the error «collect2: error: ld returned 1 exit status
make: *** [Makefile:910: libsecp256k1.la] Error 1
🗯 ERROR: Could not build secp256k1″
Источник
secp256k1 / libsecp256k1 errors when building with Docker #1352
Comments
dwalintukan commented Jan 15, 2019
Describe your issue here.
Building the Docker version comes up with errors, but the explorer functionality seems to be ok for now. I haven’t noticed any direct issues because of these errors. I just wanted to bring up this issue in case it is affecting parts of the explorer that I am not aware of.
These errors happen when building the Blockscout Docker container:
And these logs appear in the logs right after the Docker process is finished ( docker logs -f ):
Environment
- Elixir & Erlang/OTP versions ( elixir -version ): Elixir 1.7.4 (compiled with Erlang/OTP 21)
- Operating System: Mac OSX 10.14.2 Mojave
Steps to reproduce
- Clone the repo
- Follow setup instructions
- cd docker
- make start
Expected behaviour
No error logs in the build process with secp256k1 and no errors logs with libsecp256k1_nif .
Actual behaviour
Error logs appear in the build process and at the very first log items after the Docker container is built.
The text was updated successfully, but these errors were encountered:
acravenho commented Jan 15, 2019
Other users have fixed this with apk —no-cache —update add automake libtool inotify-tools autoconf in linux.
Make sure you have installed automake, libtool, inotify-tools, autoconf .
dwalintukan commented Jan 15, 2019
@acravenho I am using the Dockerfile in the repo:
zeltsi commented Jan 16, 2019 •
In some systems, you might also need to add build-essentials manually
acravenho commented Jan 16, 2019
I just fixed this issue I saw on Ubuntu 16.04
Make sure you have the correct versions:
Installing the dependencies and compiling (remove current _build and deps directories):
acravenho commented Jan 17, 2019
Closing this issue for now. Please let me know if you’re still experiencing this issue.
dwalintukan commented Jan 18, 2019
@acravenho Do you know if the Dockerfile image that its based off bitwalker/alpine-elixir-phoenix has any of these updated versions? Or better off building your own image?
acravenho commented Jan 19, 2019
@dwalintukan I did notice that bitwalker/alpine-elixir-phoenix is using Elixir 1.8 which we do not currently support. I will take a look at some of these other dependencies and get back to you.
dwalintukan commented Jan 19, 2019
@acravenho sounds good. So far I have been building with the 1.7.1 Docker image. All the higher versions have failed to build.
dwalintukan commented Jan 25, 2019 •
Just an update:
Unfortunately bitwalker/alpine-elixir-phoenix does not have a elixir 1.7.4-1 version and not sure what the equivalent esl-erlang=1:21.1.1-1 is on an Alpine container.
This is my current Dockerfile. It builds and runs but still getting same errors. Even with RUN mix deps.update libsecp256k1 it seems like its using the newest version: 0.1.10
dwalintukan commented Jan 25, 2019 •
Then modified the Dockerfile as such:
This removes some of the build errors with the libsecp256k1 lib, but I fear there is still an issue with the lib installation. Here is the old Dockerfile logs:
And after adding make gcc build-essential libgmp3-dev to the installed libs, the logs now produce this:
Which does not have this error in there now:
Источник