Closed locpv-ibl closed 4 years ago
What happens if you try running the command in a fresh environment?
You probably need to install APT package python3-dev
. See this StackOverflow question for details.
I am assuming this is resolved with the last comment, but feel free to reopen if not!
you may need to install
sudo apt update
sudo apt install python3-dev
sudo apt install libpython3.8-dev
sudo apt install python3-devel
sudo apt-get install libevent-dev
sudo apt update
for me brew install gcc pip install web3
As @samlukka mentioned, I think installing gcc should solve the issue.
my application is dockerized and this worked for me: https://stackoverflow.com/questions/29732990/installing-a-gcc-compiler-onto-a-docker-container
I did both what @samlukka & @MdSamsuzzohaShayon posted above and it worked for me afterward!
Just throwing my experience in as well, for any future folks.
Installing in a Docker container (jupyter/base-notebook base).
All I needed was gcc
From my Dockerfile:
FROM jupyter/base-notebook
...
USER root
RUN apt-get update \
&& apt-get install -yq \
gcc \
&& apt-get clean
USER $NB_UID
...
for me it was just installing the build essentials sudo apt update && sudo apt install build-essential
Afterwards I could install web3 with pip3 install web3
Doesn't work with poetry 3.11 environments for me. Works with 3.10 environments though. All the needful system devel packages are installed.
Error is:
× Building wheel for lru-dict (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
running bdist_wheel
running build
running build_ext
building 'lru' extension
creating build
creating build/temp.linux-x86_64-cpython-311
x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/remort/.cache/pypoetry/virtualenvs/graph-service-Gp9ztCYF-py3.11/include -I/usr/include/python3.11 -c lru.c -o build/temp.linux-x86_64-cpython-311/lru.o
lru.c:1:10: fatal error: Python.h: No such file or directory
1 | #include <Python.h>
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for lru-dict
Failed to build lru-dict
ERROR: Could not build wheels for lru-dict, which is required to install pyproject.toml-based projects
Doesn't work with poetry 3.11 environments for me. Works with 3.10 environments though. All the needful system devel packages are installed.
Error is:
× Building wheel for lru-dict (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [12 lines of output] running bdist_wheel running build running build_ext building 'lru' extension creating build creating build/temp.linux-x86_64-cpython-311 x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/remort/.cache/pypoetry/virtualenvs/graph-service-Gp9ztCYF-py3.11/include -I/usr/include/python3.11 -c lru.c -o build/temp.linux-x86_64-cpython-311/lru.o lru.c:1:10: fatal error: Python.h: No such file or directory 1 | #include <Python.h> | ^~~~~~~~~~ compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for lru-dict Failed to build lru-dict ERROR: Could not build wheels for lru-dict, which is required to install pyproject.toml-based projects
i have same error. Installing https://visualstudio.microsoft.com/visual-cpp-build-tools/ not help much
Same here, when I try to install web3
using python3.12.1
with
python3.12 -m venv env && source env/bin/activate && pip install web3
or poetry
I'm getting this error (for python3.10
and lower everything works just fine)
Building wheel for lru-dict (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for lru-dict (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
running bdist_wheel
running build
running build_ext
building 'lru' extension
creating build
creating build/temp.linux-x86_64-cpython-312
x86_64-linux-gnu-gcc -pthread -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/ilija/code/playground/test_env/env/include -I/usr/include/python3.12 -c lru.c -o build/temp.linux-x86_64-cpython-312/lru.o
lru.c:1:10: fatal error: Python.h: No such file or directory
1 | #include <Python.h>
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for lru-dict
Building wheel for pyunormalize (pyproject.toml) ... done
Created wheel for pyunormalize: filename=pyunormalize-15.1.0-py3-none-any.whl size=516030 sha256=e0563daf1dfb444190d299048d2c31cebd906de873812113b7c36fcda1c03a43
Stored in directory: /home/ilija/.cache/pip/wheels/2a/bd/bb/28798325f033d03157374640b90b54298b4145d04209618850
Building wheel for parsimonious (pyproject.toml) ... done
Created wheel for parsimonious: filename=parsimonious-0.9.0-py3-none-any.whl size=44298 sha256=90996aca0c5c41a3a9c44550a447d591a18707875d5f37521a4d7649ec539bd5
Stored in directory: /home/ilija/.cache/pip/wheels/83/de/47/e7f4d777272d7044e17868c7804f488944016ae93455053b14
Successfully built pyunormalize parsimonious
Failed to build lru-dict
ERROR: Could not build wheels for lru-dict, which is required to install pyproject.toml-based projects
Some ideas?
pip freeze
outputWhat was wrong?
Got error when install web3 via
sudo pip install web3