ethereum / py_ecc

Python implementation of ECC pairing and bn_128 and bls12_381 curve operations
MIT License
191 stars 82 forks source link

Error during pip installation #36

Closed hwwhww closed 5 years ago

hwwhww commented 5 years ago

Environment

Python 3.6.1

pip list
Package    Version
---------- -------
pip        18.1
setuptools 28.8.0

What is wrong?

Please include information like:

command:

pip install py_ecc==1.4.5

log:

Collecting py_ecc==1.4.5
Exception:
Traceback (most recent call last):
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2883, in _dep_map
    return self.__dep_map
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2677, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 93, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1654, in parseString
    raise exc
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1644, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1402, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3417, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1406, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3205, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 7), (line:1, col:8)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2963, in __init__
    super(Requirement, self).__init__(requirement_string)
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
    requirement_string[e.loc:e.loc + 8], e.msg
pip._vendor.packaging.requirements.InvalidRequirement: Parse error at "'(===3.2.'": Expected stringEnd

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 143, in main
    status = self.run(options, args)
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 318, in run
    resolver.resolve(requirement_set)
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_internal/resolve.py", line 102, in resolve
    self._resolve_one(requirement_set, req)
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_internal/resolve.py", line 306, in _resolve_one
    set(req_to_install.extras) - set(dist.extras)
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2840, in extras
    return [dep for dep in self._dep_map if dep]
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2885, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2895, in _compute_dependencies
    reqs.extend(parse_requirements(req))
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2956, in parse_requirements
    yield Requirement(line)
  File "/Users/hwwang/.pyenv/versions/3.6.1/envs/pyeth36b/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2965, in __init__
    raise RequirementParseError(str(e))
pip._vendor.pkg_resources.RequirementParseError: Parse error at "'(===3.2.'": Expected stringEnd

How can it be fixed

Fill this in if you know how to fix it.

zhuofanxu commented 5 years ago

I encounter the same error, it's may casued by the setuptools which the project used. Just use the 1.4.3 version before it fixed.

andrevmatos commented 5 years ago

The error is caused by typo here: https://github.com/ethereum/py_ecc/blob/b0148825721835f2a41e412465ebb8ce145bcca9/setup.py#L7

Pinning py_ecc==1.4.3 or py_ecc!=1.4.5 did the trick, but it's quite weird it make it into released version, it'd break any setup.py based release. Py-evm depends on it, which by its turn, broke half ethereum's python packages

hwwhww commented 5 years ago

@andrevmatos nice catch!!!

hwwhww commented 5 years ago

close via #37