ethereum / web3.py

A python interface for interacting with the Ethereum blockchain and ecosystem.
http://web3py.readthedocs.io
MIT License
4.95k stars 1.69k forks source link

Building wheel for lru-dict (setup.py) ... error #1391

Closed locpv-ibl closed 4 years ago

locpv-ibl commented 5 years ago
androguard==3.3.5
apt-xapian-index==0.47
asn1crypto==0.24.0
attrdict==2.0.1
autopep8==1.3.3
backcall==0.1.0
base58==1.0.3
beautifulsoup4==4.7.1
blinker==1.3
Brlapi==0.6.4
bytecode==0.5
capstone==4.0.1
certifi==2019.3.9
cffi==1.12.2
chardet==3.0.4
checkbox-support==0.22
Click==7.0
coincurve==11.0.0
colorama==0.4.1
coloredlogs==10.0
command-not-found==0.3
configparser==3.7.3
coverage==4.5.2
cryptography==2.6.1
crytic-compile==0.1.2
cycler==0.10.0
cytoolz==0.9.0.1
decorator==4.4.0
defer==1.0.6
delegator.py==0.1.1
dictionaries==0.0.1
docker-py==1.10.6
docker-pycreds==0.4.0
eth-abi==1.3.0
eth-account==0.3.0
eth-hash==0.2.0
eth-keyfile==0.5.1
eth-keys==0.2.1
eth-rlp==0.1.2
eth-tester==0.1.0b32
eth-typing==2.0.0
eth-utils==1.4.1
ethereum==2.3.2
ethereum-input-decoder==0.2.2
feedparser==5.1.3
Flask==1.0.2
Flask-Dropzone==1.5.3
Flask-Uploads==0.2.1
Flask-WTF==0.14.2
frida==12.4.1
frida-tools==1.3.2
future==0.17.1
guacamole==0.9.2
hexbytes==0.1.0
html5lib==0.999
httplib2==0.9.1
humanfriendly==4.18
idna==2.8
ipfshttpclient==0.4.12
ipython==7.3.0
ipython-genutils==0.2.0
itsdangerous==1.1.0
jedi==0.13.3
Jinja2==2.10
jsonschema==2.6.0
kazam==1.4.5
kiwisolver==1.0.1
louis==2.6.4
lxml==3.5.0
Mako==1.0.3
manticore==0.3.0
MarkupSafe==0.23
matplotlib==3.0.3
mock==2.0.0
multiaddr==0.0.8
mythril==0.20.0
neo-boa==0.3.7
netaddr==0.7.19
networkx==2.2
numpy==1.16.2
oauthlib==1.0.3
objection==1.5.2
onboard==1.2.0
oneconf==0.3.9
padme==1.1.1
parsimonious==0.8.1
parso==0.3.4
pbkdf2==1.3
pbr==5.1.2
persistent==4.4.3
pexpect==4.6.0
pickleshare==0.7.5
Pillow==3.1.2
piston-mini-client==0.7.5
plainbox==0.25
play-scraper==0.5.3
ply==3.11
plyvel==1.0.5
prettytable==0.7.2
prompt-toolkit==2.0.9
ptyprocess==0.6.0
py-ecc==1.4.2
py-flags==1.1.2
py-solc==3.2.0
pyasn1==0.1.9
pycodestyle==2.3.1
pycparser==2.19
pycrypto==2.6.1
pycryptodome==3.7.3
pycups==1.9.73
pycurl==7.43.0
pydot==1.4.1
pyelftools==0.25
pyethash==0.1.27
pyevmasm==0.2.0
Pygments==2.3.1
pygobject==3.20.0
PyJWT==1.3.0
pyOpenSSL==19.0.0
pyparsing==2.3.1
pysha3==1.0.2
python-apt==1.1.0b1+ubuntu0.16.4.5
python-dateutil==2.8.0
python-debian==0.1.27
python-systemd==231
pyxdg==0.25
PyYAML==3.13
reportlab==3.3.0
repoze.lru==0.7
requests==2.21.0
requests-futures==0.9.9
rlp==1.1.0
scrypt==0.8.13
semantic-version==2.6.0
sessioninstaller==0.0.0
six==1.12.0
slither-analyzer==0.6.4
software-center-aptd-plugins==0.0.0
soupsieve==1.8
tabulate==0.8.3
toolz==0.9.0
traitlets==4.3.2
transaction==2.4.0
ubuntu-drivers-common==0.0.0
ufw==0.35
unattended-upgrades==0.1
unicorn==1.0.1
unity-scope-calculator==0.1
unity-scope-chromiumbookmarks==0.1
unity-scope-colourlovers==0.1
unity-scope-devhelp==0.1
unity-scope-firefoxbookmarks==0.1
unity-scope-gdrive==0.7
unity-scope-manpages==0.1
unity-scope-openclipart==0.1
unity-scope-texdoc==0.1
unity-scope-tomboy==0.1
unity-scope-virtualbox==0.1
unity-scope-yelp==0.1
unity-scope-zotero==0.1
urllib3==1.24.1
usb-creator==0.3.0
varint==1.0.2
vboxapi==1.0
wcwidth==0.1.7
websocket-client==0.55.0
websockets==6.0
Werkzeug==0.14.1
wrapt==1.11.2
WTForms==2.2.1
xkit==0.0.0
XlsxWriter==0.7.3
z3-solver==4.8.5.0
z3-solver-mythril==4.8.4.1
zope.interface==4.6.0

What was wrong?

Got error when install web3 via sudo pip install web3

Requirement already satisfied: rlp<2,>=0.6.0 in /usr/local/lib/python3.6/dist-packages (from eth-rlp<1,>=0.1.2->eth-account<0.4.0,>=0.2.1->web3) (1.1.0)
Building wheels for collected packages: lru-dict
  Building wheel for lru-dict (setup.py) ... error
  ERROR: Complete output from command /usr/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-x2rgzr__/lru-dict/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 /tmp/pip-wheel-llgkpfxz --python-tag cp36:
  ERROR: running bdist_wheel
  running build
  running build_ext
  building 'lru' extension
  creating build
  creating build/temp.linux-x86_64-3.6
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c lru.c -o build/temp.linux-x86_64-3.6/lru.o
  lru.c:1:20: fatal error: Python.h: No such file or directory
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for lru-dict
  Running setup.py clean for lru-dict
Failed to build lru-dict
Installing collected packages: lru-dict, web3
  Running setup.py install for lru-dict ... error
    ERROR: Complete output from command /usr/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-x2rgzr__/lru-dict/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-4e285uo7/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_ext
    building 'lru' extension
    creating build
    creating build/temp.linux-x86_64-3.6
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c lru.c -o build/temp.linux-x86_64-3.6/lru.o
    lru.c:1:20: fatal error: Python.h: No such file or directory
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command "/usr/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-x2rgzr__/lru-dict/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-4e285uo7/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-x2rgzr__/lru-dict/
kclowes commented 5 years ago

What happens if you try running the command in a fresh environment?

filips123 commented 5 years ago

You probably need to install APT package python3-dev. See this StackOverflow question for details.

kclowes commented 4 years ago

I am assuming this is resolved with the last comment, but feel free to reopen if not!

MdSamsuzzohaShayon commented 3 years ago

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
samlukka commented 2 years ago

for me brew install gcc pip install web3

rahulsw99 commented 2 years ago

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

mswezey23 commented 2 years ago

I did both what @samlukka & @MdSamsuzzohaShayon posted above and it worked for me afterward!

cameronhr commented 2 years ago

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
...
bruderbuck commented 1 year ago

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

remort commented 1 year ago

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
aresstokrat commented 1 year ago

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

ilijapet commented 6 months ago

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?