Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg_resources.RequirementParseError: Invalid requirement, parse error at "'+https:/'" #2568

Open
Kunsi opened this issue Feb 14, 2021 · 2 comments

Comments

@Kunsi
Copy link

Kunsi commented Feb 14, 2021

I'm using a git+https:// url in my requirements.txt to load a module which i wrote, but which isn't published to PyPI (yet). pip install -r requirements.txt works fine installing that module, however pyparsing fails, throwing the exception shown in the title.

requirements.txt

bundlewrap>=4.4.2
PyNaCl
git+https://git.kunsmann.eu/kunsi/bundlewrap-pass.git#egg=bundlewrap-pass

Full Traceback:

Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/bundlewrap_kunsi-bwpass/venv/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 90, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/var/lib/jenkins/workspace/bundlewrap_kunsi-bwpass/venv/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1654, in parseString
    raise exc
  File "/var/lib/jenkins/workspace/bundlewrap_kunsi-bwpass/venv/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1644, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "/var/lib/jenkins/workspace/bundlewrap_kunsi-bwpass/venv/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1402, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/var/lib/jenkins/workspace/bundlewrap_kunsi-bwpass/venv/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 3417, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/var/lib/jenkins/workspace/bundlewrap_kunsi-bwpass/venv/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 1406, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/var/lib/jenkins/workspace/bundlewrap_kunsi-bwpass/venv/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py", line 3205, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pkg_resources._vendor.pyparsing.ParseException: Expected stringEnd (at char 3), (line:1, col:4)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/bundlewrap_kunsi-bwpass/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3042, in __init__
    super(Requirement, self).__init__(requirement_string)
  File "/var/lib/jenkins/workspace/bundlewrap_kunsi-bwpass/venv/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 94, in __init__
    requirement_string[e.loc:e.loc + 8]))
pkg_resources.extern.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'+https:/'"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/bundlewrap_kunsi-bwpass/venv/lib/python3.7/site-packages/bundlewrap/cmdline/__init__.py", line 124, in main
    repo = Repository(path)
  File "/var/lib/jenkins/workspace/bundlewrap_kunsi-bwpass/venv/lib/python3.7/site-packages/bundlewrap/repo.py", line 200, in __init__
    self.populate_from_path(self.path)
  File "/var/lib/jenkins/workspace/bundlewrap_kunsi-bwpass/venv/lib/python3.7/site-packages/bundlewrap/repo.py", line 484, in populate_from_path
    require(lines)
  File "/var/lib/jenkins/workspace/bundlewrap_kunsi-bwpass/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/var/lib/jenkins/workspace/bundlewrap_kunsi-bwpass/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 742, in resolve
    requirements = list(requirements)[::-1]
  File "/var/lib/jenkins/workspace/bundlewrap_kunsi-bwpass/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3035, in parse_requirements
    yield Requirement(line)
  File "/var/lib/jenkins/workspace/bundlewrap_kunsi-bwpass/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3044, in __init__
    raise RequirementParseError(str(e))
pkg_resources.RequirementParseError: Invalid requirement, parse error at "'+https:/'"

The actual application causing this error can be found on github, too: https://github.com/bundlewrap/bundlewrap/blob/master/bundlewrap/repo.py#L484

Remarks:

@RemyNtshaykolo
Copy link

RemyNtshaykolo commented Apr 16, 2021

Hi, I solved this problem by replacing git+https://git.kunsmann.eu/kunsi/bundlewrap-pass.git#egg=bundlewrap-pass
with bundlewrap-pass @ git+https://git.kunsmann.eu/kunsi/bundlewrap-pass.git#egg=bundlewrap-pass in the requirements.txt

@masadcv
Copy link

masadcv commented Sep 13, 2021

@RemyNtshaykolo any idea how I can bypass install such a package from pypi? I want to install from git, but it goes to pypi even if I give git address as mentioned here. Many thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants