Web3.py: Installation failing for web3: Error in eth-keys setup command: 'install_requires'

Created on 6 Feb 2018  路  4Comments  路  Source: ethereum/web3.py

  • Python: 2.7
  • OS: macOS (High Sierra 10.13.2)

What was wrong?

While installing web3 using pip running into following error (full trace below)

pip install web3

error in eth-keys setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected ',' or end-of-list in eth-utils>=0.5.0<1.0.0 at <1.0.0

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/tc/456w5zb55g92kgvs7qp3pjt80000gn/T/pip-build-c7er6r/eth-keys/

Not sure what exactly is the issue because I can install eth-keys separately (pip install eth-keys) and it does got installed without any issues.

MacBook-Pro:~ rz$ pip install web3
Collecting web3
Downloading web3-3.16.5.tar.gz (53kB)
100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 61kB 2.7MB/s
Requirement already satisfied: cytoolz>=0.8.2 in /Library/Python/2.7/site-packages (from web3)
Collecting eth-abi<0.6.0,>=0.5.0 (from web3)
Downloading eth-abi-0.5.0.tar.gz
Collecting eth-utils<1.0.0,>=0.7.1 (from web3)
Downloading eth-utils-0.7.4.tar.gz
Collecting lru-dict>=1.1.6 (from web3)
Downloading lru-dict-1.1.6.tar.gz
Requirement already satisfied: pysha3>=0.3 in /Library/Python/2.7/site-packages (from web3)
Requirement already satisfied: requests>=2.12.4 in /Library/Python/2.7/site-packages (from web3)
Collecting rlp>=0.4.7 (from web3)
Downloading rlp-0.6.0.tar.gz
Requirement already satisfied: toolz>=0.8.2 in /Library/Python/2.7/site-packages (from web3)
Collecting eth-tester==0.1.0b11 (from web3)
Downloading eth-tester-0.1.0b11.tar.gz (48kB)
100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 51kB 3.0MB/s
Requirement already satisfied: certifi>=2017.4.17 in /Library/Python/2.7/site-packages (from requests>=2.12.4->web3)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Library/Python/2.7/site-packages (from requests>=2.12.4->web3)
Requirement already satisfied: idna<2.7,>=2.5 in /Library/Python/2.7/site-packages (from requests>=2.12.4->web3)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /Library/Python/2.7/site-packages (from requests>=2.12.4->web3)
Collecting semantic_version<3.0.0,>=2.6.0 (from eth-tester==0.1.0b11->web3)
Downloading semantic_version-2.6.0.tar.gz
Collecting eth-keys<0.2.0,>=0.1.0b3 (from eth-tester==0.1.0b11->web3)
Downloading eth-keys-0.1.0b4.tar.gz
Complete output from command python setup.py egg_info:

Installed /private/var/folders/tc/456w5zb55g92kgvs7qp3pjt80000gn/T/pip-build-c7er6r/eth-keys/.eggs/setuptools_markdown-0.2-py2.7.egg
Searching for pypandoc
Reading https://pypi.python.org/simple/pypandoc/
Best match: pypandoc 1.4
Downloading https://pypi.python.org/packages/71/81/00184643e5a10a456b4118fc12c96780823adb8ed974eb2289f29703b29b/pypandoc-1.4.tar.gz#md5=28d28cf8f1942abf680c040707cee55a
Processing pypandoc-1.4.tar.gz
Writing /var/folders/tc/456w5zb55g92kgvs7qp3pjt80000gn/T/easy_install-mdbpC0/pypandoc-1.4/setup.cfg
Running pypandoc-1.4/setup.py -q bdist_egg --dist-dir /var/folders/tc/456w5zb55g92kgvs7qp3pjt80000gn/T/easy_install-mdbpC0/pypandoc-1.4/egg-dist-tmp-1D2CT_
zip_safe flag not set; analyzing archive contents...
pypandoc.__init__: module references __file__
creating /private/var/folders/tc/456w5zb55g92kgvs7qp3pjt80000gn/T/pip-build-c7er6r/eth-keys/.eggs/pypandoc-1.4-py2.7.egg
Extracting pypandoc-1.4-py2.7.egg to /private/var/folders/tc/456w5zb55g92kgvs7qp3pjt80000gn/T/pip-build-c7er6r/eth-keys/.eggs

Installed /private/var/folders/tc/456w5zb55g92kgvs7qp3pjt80000gn/T/pip-build-c7er6r/eth-keys/.eggs/pypandoc-1.4-py2.7.egg
error in eth-keys setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected ',' or end-of-list in eth-utils>=0.5.0<1.0.0 at <1.0.0

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/tc/456w5zb55g92kgvs7qp3pjt80000gn/T/pip-build-c7er6r/eth-keys/

Most helpful comment

@carver manage to install web3 in virtualenv. Thanks!

Closing the issue.

All 4 comments

Can you try a pip install -U pip setuptools wheel and re-run? I think more recent versions of pip/setuptools can handle that missing comma.

The missing comma is fixed in more recent versions of eth-keys, but web3.py v3 is not compatible with more recent versions for other reasons.

Thanks @carver I did try running pip install -U setuptools wheel but ran into following error.

MacBook-Pro:~ rz$ pip install -U pip setuptools wheel

Requirement already up-to-date: pip in /Library/Python/2.7/site-packages
Collecting setuptools
  Downloading setuptools-38.5.1-py2.py3-none-any.whl (489kB)
    100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 491kB 1.9MB/s 
Requirement already up-to-date: wheel in /Library/Python/2.7/site-packages
Installing collected packages: setuptools
  Found existing installation: setuptools 18.5
    Uninstalling setuptools-18.5:
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 778, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 299, in move
    copytree(src, real_dst, symlinks=True)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 208, in copytree
    raise Error, errors
Error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', '/tmp/pip-R9TbBJ-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-R9TbBJ-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', '/tmp/pip-R9TbBJ-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', "[Errno 1] Operation not permitted: '/tmp/pip-R9TbBJ-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', '/tmp/pip-R9TbBJ-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', "[Errno 1] Operation not permitted: '/tmp/pip-R9TbBJ-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', '/tmp/pip-R9TbBJ-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-R9TbBJ-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', '/tmp/pip-R9TbBJ-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', "[Errno 1] Operation not permitted: '/tmp/pip-R9TbBJ-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib'")]

Ah, for a variety of reasons it can be really messy to install python libraries to your global environment. Set up a virtual environment like so: http://web3py.readthedocs.io/en/stable/quickstart.html#environment

Then run the pip install -U pip setuptools wheel, then finally the pip install web3.

@carver manage to install web3 in virtualenv. Thanks!

Closing the issue.

Was this page helpful?
0 / 5 - 0 ratings