python-nostr
python-nostr copied to clipboard
Also unable to install. 'pip install nostr' fails
`(base) C:\Repository>pip install nostr Collecting nostr Using cached nostr-0.0.2-py3-none-any.whl (15 kB) Requirement already satisfied: cffi>=1.15.0 in c:\users\myname\appdata\local\miniconda3\lib\site-packages (from nostr) (1.15.1) Requirement already satisfied: cryptography>=37.0.4 in c:\users\myname\appdata\local\miniconda3\lib\site-packages (from nostr) (39.0.1) Requirement already satisfied: pycparser>=2.21 in c:\users\myname\appdata\local\miniconda3\lib\site-packages (from nostr) (2.21) Collecting secp256k1>=0.14.0 (from nostr) Using cached secp256k1-0.14.0.tar.gz (2.4 MB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [1 lines of output] 'pkg-config' is required to install this package. Please see the README for details. [end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed
× Encountered error while generating package metadata. ╰─> See above for output.
note: This is an issue with the package mentioned above, not pip. hint: See above for details.`
I messed around with trying to install 'pkg-config' and adding it to my path, but that didn't seem to help. What is going on?
I was able to install pkg-config using miniconda
conda create -n myenv python=3.9
conda activate myenv
conda install -c conda-forge pkg-config
pip install --use-pep517 nostr==0.0.2
Check this Dockerfile https://github.com/raymonostr/nip57-server/blob/main/Dockerfile - you need pkg-config and build-essential to build the secp256k1
I got a similar issue from a Docker container, I fixed it with those packages installation:
RUN apt-get update && apt-get install -y pkg-config libsecp256k1-dev build-essential
On Mac you can do brew install pkgconfig