无法在 Pycharm、linux 机器上安装 web3py

发布于 2025-01-10 08:21:27 字数 14365 浏览 2 评论 0原文

在 Pycharm 中安装 web3 包时遇到问题。我已经老了,对于软件包安装一无所知。通过 pip install 或解释器设置/添加包也会发生相同的错误。我不知道还能尝试什么,stackoverflow 给了我一个错误,因为它说我需要添加更多详细信息。

操作系统:Linux Mint 20.1 皮查姆:2021.1.3 Python:3.8.10

这个答案有效: “你必须安装 apt install python3.8-dev – 弗拉斯 ”

Collecting web3
  Using cached web3-5.28.0-py3-none-any.whl (499 kB)
Collecting eth-utils<2.0.0,>=1.9.5
  Using cached eth_utils-1.10.0-py3-none-any.whl (24 kB)
Collecting aiohttp<4,>=3.7.4.post0
  Using cached aiohttp-3.8.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.3 MB)
Collecting lru-dict<2.0.0,>=1.1.6
  Using cached lru-dict-1.1.7.tar.gz (10 kB)
  Preparing metadata (setup.py) ... done
Collecting hexbytes<1.0.0,>=0.1.0
  Using cached hexbytes-0.2.2-py3-none-any.whl (6.1 kB)
Requirement already satisfied: requests<3.0.0,>=2.16.0 in /usr/lib/python3/dist-packages (from web3) (2.22.0)
Collecting eth-abi<3.0.0,>=2.0.0b6
  Using cached eth_abi-2.1.1-py3-none-any.whl (27 kB)
Collecting ipfshttpclient==0.8.0a2
  Using cached ipfshttpclient-0.8.0a2-py3-none-any.whl (82 kB)
Collecting eth-account<0.6.0,>=0.5.7
  Using cached eth_account-0.5.7-py3-none-any.whl (101 kB)
Collecting jsonschema<4.0.0,>=3.2.0
  Using cached jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
Collecting protobuf<4,>=3.10.0
  Using cached protobuf-3.19.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB)
Collecting eth-hash[pycryptodome]<1.0.0,>=0.2.0
  Using cached eth_hash-0.3.2-py3-none-any.whl (8.8 kB)
Collecting eth-typing<3.0.0,>=2.0.0
  Using cached eth_typing-2.3.0-py3-none-any.whl (6.2 kB)
Collecting websockets<10,>=9.1
  Using cached websockets-9.1-cp38-cp38-manylinux2010_x86_64.whl (102 kB)
Collecting multiaddr>=0.0.7
  Using cached multiaddr-0.0.9-py2.py3-none-any.whl (16 kB)
Collecting attrs>=17.3.0
  Using cached attrs-21.4.0-py2.py3-none-any.whl (60 kB)
Collecting frozenlist>=1.1.1
  Using cached frozenlist-1.3.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (158 kB)
Collecting async-timeout<5.0,>=4.0.0a3
  Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting yarl<2.0,>=1.0
  Using cached yarl-1.7.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (308 kB)
Collecting charset-normalizer<3.0,>=2.0
  Using cached charset_normalizer-2.0.12-py3-none-any.whl (39 kB)
Collecting aiosignal>=1.1.2
  Using cached aiosignal-1.2.0-py3-none-any.whl (8.2 kB)
Collecting multidict<7.0,>=4.5
  Using cached multidict-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (121 kB)
Collecting parsimonious<0.9.0,>=0.8.0
  Using cached parsimonious-0.8.1-py3-none-any.whl
Collecting eth-rlp<2,>=0.1.2
  Using cached eth_rlp-0.3.0-py3-none-any.whl (5.0 kB)
Collecting eth-keys<0.4.0,>=0.3.4
  Using cached eth_keys-0.3.4-py3-none-any.whl (21 kB)
Collecting rlp<3,>=1.0.0
  Using cached rlp-2.0.1-py2.py3-none-any.whl (20 kB)
Collecting bitarray<1.3.0,>=1.2.1
  Using cached bitarray-1.2.2.tar.gz (48 kB)
  Preparing metadata (setup.py) ... done
Collecting eth-keyfile<0.6.0,>=0.5.0
  Using cached eth_keyfile-0.5.1-py3-none-any.whl (8.3 kB)
Collecting pycryptodome<4,>=3.6.6
  Using cached pycryptodome-3.14.1-cp35-abi3-manylinux2010_x86_64.whl (2.0 MB)
Collecting cytoolz<1.0.0,>=0.10.1
  Using cached cytoolz-0.11.2.tar.gz (481 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: six>=1.11.0 in /usr/lib/python3/dist-packages (from jsonschema<4.0.0,>=3.2.0->web3) (1.14.0)
Collecting pyrsistent>=0.14.0
  Using cached pyrsistent-0.18.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (119 kB)
Requirement already satisfied: setuptools in ./venv/lib/python3.8/site-packages (from jsonschema<4.0.0,>=3.2.0->web3) (60.9.3)
Requirement already satisfied: toolz>=0.8.0 in ./venv/lib/python3.8/site-packages (from cytoolz<1.0.0,>=0.10.1->eth-utils<2.0.0,>=1.9.5->web3) (0.11.2)
Collecting eth-rlp<2,>=0.1.2
  Using cached eth_rlp-0.2.1-py3-none-any.whl (5.0 kB)
Requirement already satisfied: varint in ./venv/lib/python3.8/site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->web3) (1.0.2)
Collecting base58
  Using cached base58-2.1.1-py3-none-any.whl (5.6 kB)
Requirement already satisfied: netaddr in ./venv/lib/python3.8/site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->web3) (0.8.0)
Requirement already satisfied: idna>=2.0 in /usr/lib/python3/dist-packages (from yarl<2.0,>=1.0->aiohttp<4,>=3.7.4.post0->web3) (2.8)
Building wheels for collected packages: lru-dict, bitarray, cytoolz
  Building wheel for lru-dict (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel 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-3.8
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/bs/PycharmProjects/SOLIDITY_TESTING/venv/include -I/usr/include/python3.8 -c lru.c -o build/temp.linux-x86_64-3.8/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
  Running setup.py clean for lru-dict
  Building wheel for bitarray (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.8
      creating build/lib.linux-x86_64-3.8/bitarray
      copying bitarray/test_bitarray.py -> build/lib.linux-x86_64-3.8/bitarray
      copying bitarray/__init__.py -> build/lib.linux-x86_64-3.8/bitarray
      copying bitarray/test_util.py -> build/lib.linux-x86_64-3.8/bitarray
      copying bitarray/util.py -> build/lib.linux-x86_64-3.8/bitarray
      running build_ext
      building 'bitarray._bitarray' extension
      creating build/temp.linux-x86_64-3.8
      creating build/temp.linux-x86_64-3.8/bitarray
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/bs/PycharmProjects/SOLIDITY_TESTING/venv/include -I/usr/include/python3.8 -c bitarray/_bitarray.c -o build/temp.linux-x86_64-3.8/bitarray/_bitarray.o
      bitarray/_bitarray.c:12:10: fatal error: Python.h: No such file or directory
         12 | #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 bitarray
  Running setup.py clean for bitarray
  Building wheel for cytoolz (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [60 lines of output]
      [1/5] Cythonizing cytoolz/utils.pyx
      [2/5] Cythonizing cytoolz/dicttoolz.pyx
      [3/5] Cythonizing cytoolz/functoolz.pyx
      [4/5] Cythonizing cytoolz/itertoolz.pyx
      [5/5] Cythonizing cytoolz/recipes.pyx
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.8
      creating build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/_version.py -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/__init__.py -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/_signatures.py -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/compatibility.py -> build/lib.linux-x86_64-3.8/cytoolz
      creating build/lib.linux-x86_64-3.8/cytoolz/curried
      copying cytoolz/curried/exceptions.py -> build/lib.linux-x86_64-3.8/cytoolz/curried
      copying cytoolz/curried/__init__.py -> build/lib.linux-x86_64-3.8/cytoolz/curried
      copying cytoolz/curried/operator.py -> build/lib.linux-x86_64-3.8/cytoolz/curried
      copying cytoolz/dicttoolz.pyx -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/utils.pyx -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/recipes.pyx -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/itertoolz.pyx -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/functoolz.pyx -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/itertoolz.pxd -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/dicttoolz.pxd -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/utils.pxd -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/recipes.pxd -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/cpython.pxd -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/functoolz.pxd -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/__init__.pxd -> build/lib.linux-x86_64-3.8/cytoolz
      creating build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_curried_toolzlike.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_serialization.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_functoolz.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_docstrings.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_recipes.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_dicttoolz.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_curried.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_dev_skip_test.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_utils.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_inspect_args.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_itertoolz.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_compatibility.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_signatures.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_none_safe.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_embedded_sigs.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/dev_skip_test.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_doctests.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_tlz.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      running build_ext
      building 'cytoolz.dicttoolz' extension
      creating build/temp.linux-x86_64-3.8
      creating build/temp.linux-x86_64-3.8/cytoolz
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/bs/PycharmProjects/SOLIDITY_TESTING/venv/include -I/usr/include/python3.8 -c cytoolz/dicttoolz.c -o build/temp.linux-x86_64-3.8/cytoolz/dicttoolz.o
      cytoolz/dicttoolz.c:19:10: fatal error: Python.h: No such file or directory
         19 | #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 cytoolz
  Running setup.py clean for cytoolz
Failed to build lru-dict bitarray cytoolz
Installing collected packages: lru-dict, bitarray, websockets, pyrsistent, pycryptodome, protobuf, parsimonious, multidict, hexbytes, frozenlist, eth-typing, eth-hash, cytoolz, charset-normalizer, base58, attrs, async-timeout, yarl, multiaddr, jsonschema, eth-utils, aiosignal, rlp, ipfshttpclient, eth-keys, eth-abi, aiohttp, eth-rlp, eth-keyfile, eth-account, web3
  Running setup.py install for lru-dict ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for lru-dict did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      running install
      /home/bs/PycharmProjects/SOLIDITY_TESTING/venv/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_ext
      building 'lru' extension
      creating build
      creating build/temp.linux-x86_64-3.8
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/bs/PycharmProjects/SOLIDITY_TESTING/venv/include -I/usr/include/python3.8 -c lru.c -o build/temp.linux-x86_64-3.8/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: legacy-install-failure

× Encountered error while trying to install package.
╰─> lru-dict

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

having problems installing web3 package in Pycharm. I am old and clueless when it comes to package installations. The same errors occur either through pip install or interpreter settings/add package. I do not know what else to try and stackoverflow is giving me an error because it says I need to add more details.

OS: Linux Mint 20.1
Pycharm: 2021.1.3
Python: 3.8.10

This answer worked:
"You have to install apt install python3.8-dev –
furas
"

Collecting web3
  Using cached web3-5.28.0-py3-none-any.whl (499 kB)
Collecting eth-utils<2.0.0,>=1.9.5
  Using cached eth_utils-1.10.0-py3-none-any.whl (24 kB)
Collecting aiohttp<4,>=3.7.4.post0
  Using cached aiohttp-3.8.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.3 MB)
Collecting lru-dict<2.0.0,>=1.1.6
  Using cached lru-dict-1.1.7.tar.gz (10 kB)
  Preparing metadata (setup.py) ... done
Collecting hexbytes<1.0.0,>=0.1.0
  Using cached hexbytes-0.2.2-py3-none-any.whl (6.1 kB)
Requirement already satisfied: requests<3.0.0,>=2.16.0 in /usr/lib/python3/dist-packages (from web3) (2.22.0)
Collecting eth-abi<3.0.0,>=2.0.0b6
  Using cached eth_abi-2.1.1-py3-none-any.whl (27 kB)
Collecting ipfshttpclient==0.8.0a2
  Using cached ipfshttpclient-0.8.0a2-py3-none-any.whl (82 kB)
Collecting eth-account<0.6.0,>=0.5.7
  Using cached eth_account-0.5.7-py3-none-any.whl (101 kB)
Collecting jsonschema<4.0.0,>=3.2.0
  Using cached jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
Collecting protobuf<4,>=3.10.0
  Using cached protobuf-3.19.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB)
Collecting eth-hash[pycryptodome]<1.0.0,>=0.2.0
  Using cached eth_hash-0.3.2-py3-none-any.whl (8.8 kB)
Collecting eth-typing<3.0.0,>=2.0.0
  Using cached eth_typing-2.3.0-py3-none-any.whl (6.2 kB)
Collecting websockets<10,>=9.1
  Using cached websockets-9.1-cp38-cp38-manylinux2010_x86_64.whl (102 kB)
Collecting multiaddr>=0.0.7
  Using cached multiaddr-0.0.9-py2.py3-none-any.whl (16 kB)
Collecting attrs>=17.3.0
  Using cached attrs-21.4.0-py2.py3-none-any.whl (60 kB)
Collecting frozenlist>=1.1.1
  Using cached frozenlist-1.3.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (158 kB)
Collecting async-timeout<5.0,>=4.0.0a3
  Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting yarl<2.0,>=1.0
  Using cached yarl-1.7.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (308 kB)
Collecting charset-normalizer<3.0,>=2.0
  Using cached charset_normalizer-2.0.12-py3-none-any.whl (39 kB)
Collecting aiosignal>=1.1.2
  Using cached aiosignal-1.2.0-py3-none-any.whl (8.2 kB)
Collecting multidict<7.0,>=4.5
  Using cached multidict-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (121 kB)
Collecting parsimonious<0.9.0,>=0.8.0
  Using cached parsimonious-0.8.1-py3-none-any.whl
Collecting eth-rlp<2,>=0.1.2
  Using cached eth_rlp-0.3.0-py3-none-any.whl (5.0 kB)
Collecting eth-keys<0.4.0,>=0.3.4
  Using cached eth_keys-0.3.4-py3-none-any.whl (21 kB)
Collecting rlp<3,>=1.0.0
  Using cached rlp-2.0.1-py2.py3-none-any.whl (20 kB)
Collecting bitarray<1.3.0,>=1.2.1
  Using cached bitarray-1.2.2.tar.gz (48 kB)
  Preparing metadata (setup.py) ... done
Collecting eth-keyfile<0.6.0,>=0.5.0
  Using cached eth_keyfile-0.5.1-py3-none-any.whl (8.3 kB)
Collecting pycryptodome<4,>=3.6.6
  Using cached pycryptodome-3.14.1-cp35-abi3-manylinux2010_x86_64.whl (2.0 MB)
Collecting cytoolz<1.0.0,>=0.10.1
  Using cached cytoolz-0.11.2.tar.gz (481 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: six>=1.11.0 in /usr/lib/python3/dist-packages (from jsonschema<4.0.0,>=3.2.0->web3) (1.14.0)
Collecting pyrsistent>=0.14.0
  Using cached pyrsistent-0.18.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (119 kB)
Requirement already satisfied: setuptools in ./venv/lib/python3.8/site-packages (from jsonschema<4.0.0,>=3.2.0->web3) (60.9.3)
Requirement already satisfied: toolz>=0.8.0 in ./venv/lib/python3.8/site-packages (from cytoolz<1.0.0,>=0.10.1->eth-utils<2.0.0,>=1.9.5->web3) (0.11.2)
Collecting eth-rlp<2,>=0.1.2
  Using cached eth_rlp-0.2.1-py3-none-any.whl (5.0 kB)
Requirement already satisfied: varint in ./venv/lib/python3.8/site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->web3) (1.0.2)
Collecting base58
  Using cached base58-2.1.1-py3-none-any.whl (5.6 kB)
Requirement already satisfied: netaddr in ./venv/lib/python3.8/site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->web3) (0.8.0)
Requirement already satisfied: idna>=2.0 in /usr/lib/python3/dist-packages (from yarl<2.0,>=1.0->aiohttp<4,>=3.7.4.post0->web3) (2.8)
Building wheels for collected packages: lru-dict, bitarray, cytoolz
  Building wheel for lru-dict (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel 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-3.8
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/bs/PycharmProjects/SOLIDITY_TESTING/venv/include -I/usr/include/python3.8 -c lru.c -o build/temp.linux-x86_64-3.8/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
  Running setup.py clean for lru-dict
  Building wheel for bitarray (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.8
      creating build/lib.linux-x86_64-3.8/bitarray
      copying bitarray/test_bitarray.py -> build/lib.linux-x86_64-3.8/bitarray
      copying bitarray/__init__.py -> build/lib.linux-x86_64-3.8/bitarray
      copying bitarray/test_util.py -> build/lib.linux-x86_64-3.8/bitarray
      copying bitarray/util.py -> build/lib.linux-x86_64-3.8/bitarray
      running build_ext
      building 'bitarray._bitarray' extension
      creating build/temp.linux-x86_64-3.8
      creating build/temp.linux-x86_64-3.8/bitarray
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/bs/PycharmProjects/SOLIDITY_TESTING/venv/include -I/usr/include/python3.8 -c bitarray/_bitarray.c -o build/temp.linux-x86_64-3.8/bitarray/_bitarray.o
      bitarray/_bitarray.c:12:10: fatal error: Python.h: No such file or directory
         12 | #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 bitarray
  Running setup.py clean for bitarray
  Building wheel for cytoolz (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [60 lines of output]
      [1/5] Cythonizing cytoolz/utils.pyx
      [2/5] Cythonizing cytoolz/dicttoolz.pyx
      [3/5] Cythonizing cytoolz/functoolz.pyx
      [4/5] Cythonizing cytoolz/itertoolz.pyx
      [5/5] Cythonizing cytoolz/recipes.pyx
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.8
      creating build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/_version.py -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/__init__.py -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/_signatures.py -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/compatibility.py -> build/lib.linux-x86_64-3.8/cytoolz
      creating build/lib.linux-x86_64-3.8/cytoolz/curried
      copying cytoolz/curried/exceptions.py -> build/lib.linux-x86_64-3.8/cytoolz/curried
      copying cytoolz/curried/__init__.py -> build/lib.linux-x86_64-3.8/cytoolz/curried
      copying cytoolz/curried/operator.py -> build/lib.linux-x86_64-3.8/cytoolz/curried
      copying cytoolz/dicttoolz.pyx -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/utils.pyx -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/recipes.pyx -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/itertoolz.pyx -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/functoolz.pyx -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/itertoolz.pxd -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/dicttoolz.pxd -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/utils.pxd -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/recipes.pxd -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/cpython.pxd -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/functoolz.pxd -> build/lib.linux-x86_64-3.8/cytoolz
      copying cytoolz/__init__.pxd -> build/lib.linux-x86_64-3.8/cytoolz
      creating build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_curried_toolzlike.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_serialization.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_functoolz.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_docstrings.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_recipes.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_dicttoolz.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_curried.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_dev_skip_test.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_utils.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_inspect_args.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_itertoolz.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_compatibility.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_signatures.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_none_safe.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_embedded_sigs.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/dev_skip_test.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_doctests.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      copying cytoolz/tests/test_tlz.py -> build/lib.linux-x86_64-3.8/cytoolz/tests
      running build_ext
      building 'cytoolz.dicttoolz' extension
      creating build/temp.linux-x86_64-3.8
      creating build/temp.linux-x86_64-3.8/cytoolz
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/bs/PycharmProjects/SOLIDITY_TESTING/venv/include -I/usr/include/python3.8 -c cytoolz/dicttoolz.c -o build/temp.linux-x86_64-3.8/cytoolz/dicttoolz.o
      cytoolz/dicttoolz.c:19:10: fatal error: Python.h: No such file or directory
         19 | #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 cytoolz
  Running setup.py clean for cytoolz
Failed to build lru-dict bitarray cytoolz
Installing collected packages: lru-dict, bitarray, websockets, pyrsistent, pycryptodome, protobuf, parsimonious, multidict, hexbytes, frozenlist, eth-typing, eth-hash, cytoolz, charset-normalizer, base58, attrs, async-timeout, yarl, multiaddr, jsonschema, eth-utils, aiosignal, rlp, ipfshttpclient, eth-keys, eth-abi, aiohttp, eth-rlp, eth-keyfile, eth-account, web3
  Running setup.py install for lru-dict ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for lru-dict did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      running install
      /home/bs/PycharmProjects/SOLIDITY_TESTING/venv/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_ext
      building 'lru' extension
      creating build
      creating build/temp.linux-x86_64-3.8
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/bs/PycharmProjects/SOLIDITY_TESTING/venv/include -I/usr/include/python3.8 -c lru.c -o build/temp.linux-x86_64-3.8/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: legacy-install-failure

× Encountered error while trying to install package.
╰─> lru-dict

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

仅冇旳回忆 2025-01-17 08:21:27

您可以看到错误

Python.h: No such file or directory

,这意味着它编译了一些 C/C++ 代码,并且需要 Python 源代码的 C/C++ 标头。

你必须安装

apt install python3.8-dev

In error you can see

Python.h: No such file or directory

and it means it compiles some C/C++ code and it needs C/C++ headers for Python source code.

You have to install

apt install python3.8-dev
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文