Skip to content
New issue

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

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

Already on GitHub? # to your account

Local wheel dependency fails on non-windows environments, WSL, Heroku #2256

Closed
gtalarico opened this issue May 24, 2018 · 1 comment
Closed
Labels
OS: Windows This issue affects the Windows Operating System. Type: Bug 🐛 This issue is a bug.

Comments

@gtalarico
Copy link
Contributor

gtalarico commented May 24, 2018

Expected result

Pipenv is able to install a local wheel dependency and add it to Pipfile.
The Pipfile can be then used to install dependencies on other machines, including non-windows environments.

Actual result

The generated Pipfile works locally but fails on other machines (eg linux)
Install fails with parse error

Invalid requirement, parse error at "'.\\vendor"
Steps to replicate
  • Install package from a local wheel
  • Eg. pipenv install vendor/stargate -0.14.2-py3-none-any.whl

A Pipfile is _automatically created:

# pipfile
stargate = {path = ".\\vendor\\stargate-0.14.2-py3-none-any.whl"}

(other packages omitted)

Everything runs fine locally, and the dependency is installed properly on new enviroments.
Running pipenv install on non-windows machines fails.
Traceback from running on WSL and Heroku below.

Notes

Local Pipenv: 2018.05.18
WSL: Pipenv: 2018.05.18
Heroku Pipenv: 11.8.2

Maybe it is a windows path issue, and the way the path is added on windows?
And Posix machines trip up when the read the requirement

Full tracebacks below:

WSL

gtalarico@GUI-STUDIO:~/dev/repos/genome$ pipenv install --dev
Pipfile.lock not found, creatingLocking [dev-packages] dependenciesLocking [packages] dependencies341, in <listcomp>
    c for c in req.parse_requirements(t, session=pip_requests)
  File "/home/gtalarico/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pip9/req/req_file.py", line 93, in parse_requirements
    for req in req_iter:
  File "/home/gtalarico/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pip9/req/req_file.py", line 158, in process_line
    isolated=isolated, options=req_options, wheel_cache=wheel_cache
  File "/home/gtalarico/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pip9/req/req_install.py", line 235, in from_line
    wheel_cache=wheel_cache, constraint=constraint)
  File "/home/gtalarico/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pip9/req/req_install.py", line 91, in __init__
    "Invalid requirement: '%s'\n%s" % (req, add_msg))
pip9.exceptions.InstallationError: Invalid requirement: '.\vendor\stargate==0.14.2'
Traceback (most recent call last):
  File "/home/gtalarico/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pip9/_vendor/packaging/requirements.py", line 92, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/home/gtalarico/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pip9/_vendor/pyparsing.py", line 1617, in parseString
    raise exc
  File "/home/gtalarico/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pip9/_vendor/pyparsing.py", line 1607, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "/home/gtalarico/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pip9/_vendor/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/home/gtalarico/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pip9/_vendor/pyparsing.py", line 3376, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/home/gtalarico/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pip9/_vendor/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/home/gtalarico/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pip9/_vendor/pyparsing.py", line 3698, in parseImpl
    return self.expr._parse( instring, loc, doActions, callPreParse=False )
  File "/home/gtalarico/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pip9/_vendor/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/home/gtalarico/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pip9/_vendor/pyparsing.py", line 3359, in parseImpl
    loc, resultlist = self.exprs[0]._parse( instring, loc, doActions, callPreParse=False )
  File "/home/gtalarico/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pip9/_vendor/pyparsing.py", line 1383, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/home/gtalarico/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pip9/_vendor/pyparsing.py", line 2670, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pip9._vendor.pyparsing.ParseException: Expected W:(abcd...) (at char 0), (line:1, col:1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gtalarico/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pip9/req/req_install.py", line 82, in __init__
    req = Requirement(req)
  File "/home/gtalarico/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pipenv/vendor/pip9/_vendor/packaging/requirements.py", line 96, in __init__
    requirement_string[e.loc:e.loc + 8]))
pip9._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'.\\vendor'"
gtalarico@GUI-STUDIO:~/dev/repos/genome$

Heroku TB

remote: -----> Installing dependencies with Pipenv 11.8.2…
remote:        Installing dependencies from Pipfile.lock (58b73d)…
remote:        WARNING: Invalid requirement, parse error at "'.\\vendor'"
remote:        ABORTING INSTALL... You will have to reinstall any packages that failed to install.
remote:        You may have to manually run pipenv lock when you are finished.

Update

Manually changed pipfile entry from:
stargate = {path = ".\\vendor\\stargate-0.14.2-py3-none-any.whl"}
to
stargate = {path = "./vendor/stargate-0.14.2-py3-none-any.whl"}

After the change, the Pipfile can run on linux, and windows.
So maybe the solution is, ensure Pipfile path's are always stored posix-style?


That's 100% the problem.
Fixing the path manually to posix style also fixed my failing heroku deployment using Pipenv 11.8.2

@techalchemy
Copy link
Member

@gtalarico it backslashes it locally on windows? that's really silly. that will never work on linux, we should fix

@techalchemy techalchemy added Type: Bug 🐛 This issue is a bug. OS: Windows This issue affects the Windows Operating System. labels May 24, 2018
techalchemy added a commit that referenced this issue May 26, 2018
 - Fixes #2256

Signed-off-by: Dan Ryan <dan@danryan.co>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
OS: Windows This issue affects the Windows Operating System. Type: Bug 🐛 This issue is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants