Hướng dẫn install web3 python macos - cài web3 python macos

Permalink

Show

Cannot retrieve contributors at this time

Web3.py on OSX

Developer Setup

  1. Install XCode command line tools
  1. Install all of the package dependencies

brew install openssl libffi autoconf automake libtool

  1. Install leveldb

If you are on >=OSX 10.15 Catalina you may encounter the following error with the default ZSH shell. This can be fixed by wrapping the [dev] part in quotes.

pip install -e .[dev]
zsh: no matches found: .[dev]

Run install commands as follows:

  • Version: x.x.x
  • Python: 3.9
  • OS: MAC
  • pip freeze output

<put the output from running pip freeze here>
(.venv-py3) arjun@Arjuns-MBP defianalytics % pip freeze
base58==2.1.0
certifi==2021.5.30
chardet==4.0.0
charset-normalizer==2.0.6
cytoolz==0.11.0
eth-abi==2.1.1
eth-hash==0.3.2
eth-keyfile==0.5.1
eth-keys==0.3.3
eth-rlp==0.2.1
eth-typing==2.2.2
eth-utils==1.10.0
hexbytes==0.2.2
idna==3.2
multiaddr==0.0.9
multidict==5.2.0
netaddr==0.8.0
parsimonious==0.8.1
pycryptodome==3.10.4
pyrsistent==0.18.0
requests==2.26.0
rlp==2.0.1
six==1.16.0
toolz==0.11.1
typing-extensions==3.10.0.2
urllib3==1.26.7
varint==1.0.2
yarl==1.6.3

What was wrong?

Trying to install web3 but getting an error when it comes to building wheel for lru-direct and bitarray. I'm trying to run this on a Mac and haven't found a solution yet. Any help would be appreciated.

Please include any of the following that are applicable:

  • The code which produced the error

  • pip install --upgrade web3

  • The full output of the error Collecting web3 Using cached web3-5.24.0-py3-none-any.whl (487 kB) Collecting ipfshttpclient==0.8.0a2 Using cached ipfshttpclient-0.8.0a2-py3-none-any.whl (82 kB) Requirement already satisfied: eth-hash[pycryptodome]=0.2.0 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from web3) (0.3.2) Collecting jsonschema=3.2.0 Using cached jsonschema-3.2.0-py2.py3-none-any.whl (56 kB) Collecting lru-dict=1.1.6 Using cached lru-dict-1.1.7.tar.gz (10 kB) Collecting eth-account=0.5.6 Using cached eth_account-0.5.6-py3-none-any.whl (101 kB) Collecting aiohttp=3.7.4.post0 Using cached aiohttp-3.7.4.post0-cp39-cp39-macosx_10_14_x86_64.whl (649 kB) Requirement already satisfied: eth-utils=1.9.5 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from web3) (1.10.0) Requirement already satisfied: requests=2.16.0 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from web3) (2.26.0) Requirement already satisfied: hexbytes=0.1.0 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from web3) (0.2.2) Collecting protobuf=3.10.0 Using cached protobuf-3.18.1-cp39-cp39-macosx_10_9_x86_64.whl (1.0 MB) Collecting websockets=9.1 Using cached websockets-9.1-cp39-cp39-macosx_10_9_x86_64.whl (88 kB) Requirement already satisfied: eth-abi=2.0.0b6 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from web3) (2.1.1) Requirement already satisfied: eth-typing=2.0.0 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from web3) (2.2.2) Requirement already satisfied: multiaddr>=0.0.7 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from ipfshttpclient==0.8.0a2->web3) (0.0.9) Collecting attrs>=17.3.0 Using cached attrs-21.2.0-py2.py3-none-any.whl (53 kB) Requirement already satisfied: yarl=1.0 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from aiohttp=3.7.4.post0->web3) (1.6.3) Requirement already satisfied: typing-extensions>=3.6.5 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from aiohttp=3.7.4.post0->web3) (3.10.0.2) Requirement already satisfied: chardet=2.0 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from aiohttp=3.7.4.post0->web3) (4.0.0) Requirement already satisfied: multidict=4.5 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from aiohttp=3.7.4.post0->web3) (5.2.0) Collecting async-timeout=3.0 Using cached async_timeout-3.0.1-py3-none-any.whl (8.2 kB) Requirement already satisfied: parsimonious=0.8.0 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from eth-abi=2.0.0b6->web3) (0.8.1) Requirement already satisfied: eth-keys!=0.3.2,=0.2.1 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from eth-account=0.5.6->web3) (0.3.3) Collecting bitarray=1.2.1 Using cached bitarray-1.2.2.tar.gz (48 kB) Requirement already satisfied: eth-rlp=0.1.2 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from eth-account=0.5.6->web3) (0.2.1) Requirement already satisfied: rlp=1.0.0 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from eth-account=0.5.6->web3) (2.0.1) Requirement already satisfied: eth-keyfile=0.5.0 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from eth-account=0.5.6->web3) (0.5.1) Requirement already satisfied: pycryptodome=3.6.6 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from eth-hash[pycryptodome]=0.2.0->web3) (3.10.4) Requirement already satisfied: cytoolz=0.9.0 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from eth-keyfile=0.5.0->eth-account=0.5.6->web3) (0.11.0) Requirement already satisfied: toolz>=0.8.0 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from cytoolz=0.9.0->eth-keyfile=0.5.0->eth-account=0.5.6->web3) (0.11.1) Requirement already satisfied: setuptools in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from jsonschema=3.2.0->web3) (58.2.0) Requirement already satisfied: pyrsistent>=0.14.0 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from jsonschema=3.2.0->web3) (0.18.0) Requirement already satisfied: six>=1.11.0 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from jsonschema=3.2.0->web3) (1.16.0) Requirement already satisfied: base58 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->web3) (2.1.0) Requirement already satisfied: varint in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->web3) (1.0.2) Requirement already satisfied: netaddr in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->web3) (0.8.0) Requirement already satisfied: urllib3=1.21.1 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from requests=2.16.0->web3) (1.26.7) Requirement already satisfied: certifi>=2017.4.17 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from requests=2.16.0->web3) (2021.5.30) Requirement already satisfied: idna=2.5 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from requests=2.16.0->web3) (3.2) Requirement already satisfied: charset-normalizer~=2.0.0 in /Users/arjun/.venv-py3/lib/python3.9/site-packages (from requests=2.16.0->web3) (2.0.6) Building wheels for collected packages: bitarray, lru-dict Building wheel for bitarray (setup.py) ... error ERROR: Command errored out with exit status 1: command: /Users/arjun/.venv-py3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/jp/wpvgxk415w76txzmyq4sg36m0000gn/T/pip-install-d26sbr1t/bitarray_7e42ae51235c40b6bce260fd4be19918/setup.py'"'"'; file='"'"'/private/var/folders/jp/wpvgxk415w76txzmyq4sg36m0000gn/T/pip-install-d26sbr1t/bitarray_7e42ae51235c40b6bce260fd4be19918/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/jp/wpvgxk415w76txzmyq4sg36m0000gn/T/pip-wheel-t9bjsdjo cwd: /private/var/folders/jp/wpvgxk415w76txzmyq4sg36m0000gn/T/pip-install-d26sbr1t/bitarray_7e42ae51235c40b6bce260fd4be19918/ Complete output (17 lines): running bdist_wheel running build running build_py creating build creating build/lib.macosx-11-x86_64-3.9 creating build/lib.macosx-11-x86_64-3.9/bitarray copying bitarray/util.py -> build/lib.macosx-11-x86_64-3.9/bitarray copying bitarray/init.py -> build/lib.macosx-11-x86_64-3.9/bitarray copying bitarray/test_bitarray.py -> build/lib.macosx-11-x86_64-3.9/bitarray copying bitarray/test_util.py -> build/lib.macosx-11-x86_64-3.9/bitarray running build_ext building 'bitarray._bitarray' extension creating build/temp.macosx-11-x86_64-3.9 creating build/temp.macosx-11-x86_64-3.9/bitarray clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include -I/usr/local/opt//include -I/usr/local/opt/sqlite/include -I/Users/arjun/.venv-py3/include -I/usr/local/opt//Frameworks/Python.framework/Versions/3.9/include/python3.9 -c bitarray/_bitarray.c -o build/temp.macosx-11-x86_64-3.9/bitarray/_bitarray.o clang: error: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=11' error: command '/usr/bin/clang' failed with exit code 1

    ERROR: Failed building wheel for bitarray Running setup.py clean for bitarray Building wheel for lru-dict (setup.py) ... error ERROR: Command errored out with exit status 1: command: /Users/arjun/.venv-py3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/jp/wpvgxk415w76txzmyq4sg36m0000gn/T/pip-install-d26sbr1t/lru-dict_7998f91d71c645099167ed038b95a4a1/setup.py'"'"'; file='"'"'/private/var/folders/jp/wpvgxk415w76txzmyq4sg36m0000gn/T/pip-install-d26sbr1t/lru-dict_7998f91d71c645099167ed038b95a4a1/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/jp/wpvgxk415w76txzmyq4sg36m0000gn/T/pip-wheel-w8u85rfk cwd: /private/var/folders/jp/wpvgxk415w76txzmyq4sg36m0000gn/T/pip-install-d26sbr1t/lru-dict_7998f91d71c645099167ed038b95a4a1/ Complete output (9 lines): running bdist_wheel running build running build_ext building 'lru' extension creating build creating build/temp.macosx-11-x86_64-3.9 clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include -I/usr/local/opt//include -I/usr/local/opt/sqlite/include -I/Users/arjun/.venv-py3/include -I/usr/local/opt//Frameworks/Python.framework/Versions/3.9/include/python3.9 -c lru.c -o build/temp.macosx-11-x86_64-3.9/lru.o clang: error: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=11' error: command '/usr/bin/clang' failed with exit code 1

    ERROR: Failed building wheel for lru-dict Running setup.py clean for lru-dict Failed to build bitarray lru-dict Installing collected packages: bitarray, attrs, async-timeout, websockets, protobuf, lru-dict, jsonschema, ipfshttpclient, eth-account, aiohttp, web3 Running setup.py install for bitarray ... error ERROR: Command errored out with exit status 1: command: /Users/arjun/.venv-py3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/jp/wpvgxk415w76txzmyq4sg36m0000gn/T/pip-install-d26sbr1t/bitarray_7e42ae51235c40b6bce260fd4be19918/setup.py'"'"'; file='"'"'/private/var/folders/jp/wpvgxk415w76txzmyq4sg36m0000gn/T/pip-install-d26sbr1t/bitarray_7e42ae51235c40b6bce260fd4be19918/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/jp/wpvgxk415w76txzmyq4sg36m0000gn/T/pip-record-9z7w1myw/install-record.txt --single-version-externally-managed --compile --install-headers /Users/arjun/.venv-py3/include/site/python3.9/bitarray cwd: /private/var/folders/jp/wpvgxk415w76txzmyq4sg36m0000gn/T/pip-install-d26sbr1t/bitarray_7e42ae51235c40b6bce260fd4be19918/ Complete output (17 lines): running install running build running build_py creating build creating build/lib.macosx-11-x86_64-3.9 creating build/lib.macosx-11-x86_64-3.9/bitarray copying bitarray/util.py -> build/lib.macosx-11-x86_64-3.9/bitarray copying bitarray/init.py -> build/lib.macosx-11-x86_64-3.9/bitarray copying bitarray/test_bitarray.py -> build/lib.macosx-11-x86_64-3.9/bitarray copying bitarray/test_util.py -> build/lib.macosx-11-x86_64-3.9/bitarray running build_ext building 'bitarray._bitarray' extension creating build/temp.macosx-11-x86_64-3.9 creating build/temp.macosx-11-x86_64-3.9/bitarray clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include -I/usr/local/opt//include -I/usr/local/opt/sqlite/include -I/Users/arjun/.venv-py3/include -I/usr/local/opt//Frameworks/Python.framework/Versions/3.9/include/python3.9 -c bitarray/_bitarray.c -o build/temp.macosx-11-x86_64-3.9/bitarray/_bitarray.o clang: error: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=11' error: command '/usr/bin/clang' failed with exit code 1

ERROR: Command errored out with exit status 1: /Users/arjun/.venv-py3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/jp/wpvgxk415w76txzmyq4sg36m0000gn/T/pip-install-d26sbr1t/bitarray_7e42ae51235c40b6bce260fd4be19918/setup.py'"'"'; file='"'"'/private/var/folders/jp/wpvgxk415w76txzmyq4sg36m0000gn/T/pip-install-d26sbr1t/bitarray_7e42ae51235c40b6bce260fd4be19918/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/jp/wpvgxk415w76txzmyq4sg36m0000gn/T/pip-record-9z7w1myw/install-record.txt --single-version-externally-managed --compile --install-headers /Users/arjun/.venv-py3/include/site/python3.9/bitarray Check the logs for full command output.

  • Loại nút nào bạn đã kết nối.

Làm thế nào nó có thể được cố định?

Điền vào phần này nếu bạn biết làm thế nào điều này có thể hoặc nên được sửa.


Lưu ý: Chúng tôi thích sử dụng các vấn đề để theo dõi công việc của chúng tôi.Nếu bạn nghĩ rằng bạn đã gặp phải một lỗi trong web3py hoặc có yêu cầu tính năng, bạn đang ở đúng nơi.Nếu bạn có câu hỏi thực hiện hoặc sử dụng, vui lòng tham khảo tài liệu của chúng tôi và/hoặc tham gia cuộc trò chuyện trên Discord. We prefer to use issues to track our work. If you think you've encountered a bug in web3py or
have a feature request, you're in the right place. If you have implementation or usage questions,
please refer to our documentation and/or join the conversation
on discord.