Error when installing secp256k1 library on windows - windows

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.

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

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."

I had the same problem in Ubuntu and I solved it with this solution:
sudo apt-get install libsecp256k1-dev
Source

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.

Related

Errors in downloading the python modules using pip

often I face the same error during downloading the python modules using pip. Could you guys help me sort this out? FYI I am using python 3.7v.
C:\>pip install PyAudio
Collecting PyAudio
Downloading https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Building wheels for collected packages: PyAudio
Running setup.py bdist_wheel for PyAudio ... error
Complete output from command c:\users\avinash.tripathy\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\AVINAS~1.TRI\\AppData\\Local\\Temp\\pip-install-_qfc03y7\\PyAudio\\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\AVINAS~1.TRI\AppData\Local\Temp\pip-wheel-fjb2zkz4 --python-tag cp37:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-3.7
copying src\pyaudio.py -> build\lib.win32-3.7
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Failed building wheel for PyAudio
Running setup.py clean for PyAudio
Failed to build PyAudio
Installing collected packages: PyAudio
Running setup.py install for PyAudio ... error
Complete output from command c:\users\avinash.tripathy\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\AVINAS~1.TRI\\AppData\\Local\\Temp\\pip-install-_qfc03y7\\PyAudio\\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\AVINAS~1.TRI\AppData\Local\Temp\pip-record-h2e_hkyb\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
copying src\pyaudio.py -> build\lib.win32-3.7
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Command "c:\users\avinash.tripathy\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\AVINAS~1.TRI\\AppData\\Local\\Temp\\pip-install-_qfc03y7\\PyAudio\\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\AVINAS~1.TRI\AppData\Local\Temp\pip-record-h2e_hkyb\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\AVINAS~1.TRI\AppData\Local\Temp\pip-install-_qfc03y7\PyAudio\
It doesn't look like PyAudio has a binary package available under pip. Christoph Gohlke maintains Unofficial Windows Binaries for Python Extension Packages and it has PyAudio. Download an appropriate version, then install it directly with pip install.

Failed building wheel for PySide when installing pyside on Mac

I have installed:
*Python 3.6.1
*qt/5.9.1
*sip-4.19.3
When I type
pip install pyside
Or
pip install -U PySide
I always get the error bellow:
Collecting PySide
Using cached PySide-1.2.4.tar.gz
Building wheels for collected packages: PySide
Running setup.py bdist_wheel for PySide ... error
Complete output from command /usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/tv/4rb2txws5ml_cwj0v060ym_80000gn/T/pip-build-jscv9F/PySide/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 /var/folders/tv/4rb2txws5ml_cwj0v060ym_80000gn/T/tmp5VfNR7pip-wheel- --python-tag cp27:
Removing /private/var/folders/tv/4rb2txws5ml_cwj0v060ym_80000gn/T/pip-build-jscv9F/PySide/pyside_package
running bdist_wheel
running build
Python architecture is 64bit
error: Failed to find qmake. Please specify the path to qmake with --qmake parameter.
----------------------------------------
Failed building wheel for PySide
Running setup.py clean for PySide
Failed to build PySide
Installing collected packages: PySide
Running setup.py install for PySide ... error
Complete output from command /usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/tv/4rb2txws5ml_cwj0v060ym_80000gn/T/pip-build-jscv9F/PySide/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/tv/4rb2txws5ml_cwj0v060ym_80000gn/T/pip-lTCccK-record/install-record.txt --single-version-externally-managed --compile:
Removing /private/var/folders/tv/4rb2txws5ml_cwj0v060ym_80000gn/T/pip-build-jscv9F/PySide/pyside_package
running install
running build
Python architecture is 64bit
error: Failed to find qmake. Please specify the path to qmake with --qmake parameter.
----------------------------------------
Command "/usr/local/opt/python/bin/python2.7 -u -c "import setuptools,
tokenize;__file__='/private/var/folders/tv/4rb2txws5ml_cwj0v060ym_80000gn/T/pip-build-jscv9F/PySide/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n','\n');f.close();exec(compile(code, __file__, 'exec'))" install
--record /var/folders/tv/4rb2txws5ml_cwj0v060ym_80000gn/T/pip-lTCccK-record/install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in
/private/var/folders/tv/4rb2txws5ml_cwj0v060ym_80000gn/T/pip-build-jscv9F/PySide/
Ok, I finally found a "solution".
First of all, I am not an expert (I am super new coding).
Based on my own experience below you will find a solution as well.
I need to clarify something first, there are two ways to use this GUI QT - PyQt by Riverbank Computing or(and) PySide, originally developed by Nokia.
I tried many differents ways to install PySide, but no success, so I ended up finding PyQt, that does the same thing.
Watching this video I installed the PyQT5 in my Mac OS and now it is working.
https://www.youtube.com/watch?v=2kHk8ZjxH64
Example of Hello World using PyQT
http://pythoncentral.io/intro-to-pysidepyqt-basic-widgets-and-hello-world/
The wiki.qt.io says
"PySide has included support for Python 3.2 since version 1.0.8." but it doesn't work for me.
Good lucky.

Install dlib in python3 on mac

Getting the below as error:
Collecting dlib
Using cached dlib-19.1.0.tar.gz
Installing collected packages: dlib
Running setup.py install for dlib ... error
Complete output from command /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/var/folders/x1/bsml9c1532x102zlxhqt_k380000gn/T/pip-build-_1n6svbf/dlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/x1/bsml9c1532x102zlxhqt_k380000gn/T/pip-0m_zvdwp-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
error: Cannot find cmake, ensure it is installed and in the path.
You can install cmake on OSX using `sudo brew install cmake`.
You can also specify its path with --cmake parameter.
----------------------------------------
Then sudo brew install cmake is not installing as well.
Any solutions to this.
Maybe you should use brew without sudo..
brew install cmake

"error code 1" Installing usaddress with Anaconda on Windows 7 32-bit

I am running Windows 7 and Anaconda. Attempting to install usaddress library found here: https://github.com/datamade/usaddress I have attempted this installation using a virtual env of Python 2.7 in my Anaconda3 installation, and a separately installed Anaconda 2.
I installed pip for Conda and navigated to my Scripts directory to attempt an install using pip install usaddress. It does not work, neither do many of the solutions that I have found on the internet. The error I get is this:
Command "C:\Users\User\Anaconda2\python.exe -u -c "import setuptools, tokenize;__file__='c:\users\user\appdata\local\temp\pip-build-0a_vd7\python-crfsuite\setup.py';exec(compile(getattr(tokenize, 'open'
, open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\user\appdata\local\temp\pip-mtrojm-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\user\appdata\local\temp\pip-build-0a_vd7\python-crfsuite
This is another error that seems to pop up:
Failed building wheel for python-crfsuite
Running setup.py clean for python-crfsuite
Failed to build python-crfsuite
I have also attempted to fix this error with no luck by searching Stack and other places on the internet.

Cannot install scrapy on my Mac using easy_install or pip

I am using sudo easy_install Scrapy to try and install Scrapy on my Mac (running Mac OS 10.9.2).
The installation appears to be nearly complete when I receive the error below. I can't seem to figure it out. Can anyone help?
Installed /Library/Python/2.7/site-packages/cssselect-0.9.1-py2.7.egg
Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Best match: lxml 3.3.3
Downloading https://pypi.python.org/packages/source/l/lxml/lxml-3.3.3.tar.gz#md5=f2675837b4358a5ecab5fd9a783fd0e5
Processing lxml-3.3.3.tar.gz
Running lxml-3.3.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-xwN2PB/lxml-3.3.3/egg-dist-tmp-CkAsXC
Building lxml version 3.3.3.
Building without Cython.
Using build configuration of libxslt 1.1.28
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: Setup script exited with error: command 'cc' failed with exit status 1
Edit
Using pip install scrapy, I get the error below. So neither option works.
Installing collected packages: w3lib, queuelib, lxml
Running setup.py install for w3lib
error: could not create '/Library/Python/2.7/site-packages/w3lib': Permission denied
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/86/1mln902j0jx7698nxqk69_7r0000gn/T/pip_build_zacharygallinger/w3lib/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/86/1mln902j0jx7698nxqk69_7r0000gn/T/pip-hXKj0S-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/w3lib
copying w3lib/__init__.py -> build/lib/w3lib
copying w3lib/encoding.py -> build/lib/w3lib
copying w3lib/form.py -> build/lib/w3lib
copying w3lib/html.py -> build/lib/w3lib
copying w3lib/http.py -> build/lib/w3lib
copying w3lib/url.py -> build/lib/w3lib
copying w3lib/util.py -> build/lib/w3lib
running install_lib
creating /Library/Python/2.7/site-packages/w3lib
error: could not create '/Library/Python/2.7/site-packages/w3lib': Permission denied
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/86/1mln902j0jx7698nxqk69_7r0000gn/T/pip_build_zacharygallinger/w3lib/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/86/1mln902j0jx7698nxqk69_7r0000gn/T/pip-hXKj0S-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/86/1mln902j0jx7698nxqk69_7r0000gn/T/pip_build_zacharygallinger/w3lib
Storing debug log for failure in /Users/zacharygallinger/Library/Logs/pip.log
For the time being you might be able to get past this by doing the following before building it:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
This should signal the compiler to turn these errors back into warnings. Eventually, as indicated by the error message these will be hard errors. Long term, the package maintainer will have to edit the package to not use -mno-fused-madd.
For reference: https://bitbucket.org/cffi/cffi/issue/46/unused-mno-fused-madd-clang-warnings-on-os

Resources