Skip to content

Unable to install jsonPath2 as a requirement with pip 20.1 #46

@chrisBLIT

Description

@chrisBLIT

jsonpath2 version

jsonpath2 0.4.3

Scenario:

trying to build my project with pip 20.1, I see an attribute error during installation.

Note here is a link to the exact same issue only with another library:
ansible/awx#6870

and here is the resolution:
ansible/awx#6880

tl;dr

need to remove import parse_requirements and instead install the requirements in the setup.py:

replace this: install_requires=[str(ir.req) for ir in INSTALL_REQS]

with this:

install_requires=[
'antlr4-python3-runtime==4.7.2',
'setuptools',
'six'
]

Steps to Reproduce:

Attempt to install jsonPath2 with pip 20.1

Expected Result:

Installation succeeds

Actual Result:

Get the following error: AttributeError: 'ParsedRequirement' object has no attribute 'req'

get the same error in the ticket linked above. Note that the previous version of PIP installs jsonPath2 successfully (pip 20.0.2 ).

Below is the stack track:

Collecting jsonpath2==0.4.3 Downloading *Redacted* ERROR: Command errored out with exit status 1: command: /var/lang/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ixr_gk02/jsonpath2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ixr_gk02/jsonpath2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-ftyecr7e cwd: /tmp/pip-install-ixr_gk02/jsonpath2/ Complete output (7 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-ixr_gk02/jsonpath2/setup.py", line 28, in <module> install_requires=[str(ir.req) for ir in INSTALL_REQS] File "/tmp/pip-install-ixr_gk02/jsonpath2/setup.py", line 28, in <listcomp> install_requires=[str(ir.req) for ir in INSTALL_REQS] AttributeError: 'ParsedRequirement' object has no attribute 'req'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions