InvalidRequirement with Python pip 8.1.2

775 views
Skip to first unread message

Kovacsics Róbert

unread,
Aug 16, 2016, 1:50:43 PM8/16/16
to Plover
Hello,

First of all, note that I'm not a pythonista, so this may be me misunderstanding things, but I thing there is something in one of your files that used depreciated syntax, which gives the error

installing
/tmp/nix-build-python2.7-plover-git-2016-08-16.drv-0/plover-master/dist /tmp/nix-build-python2.7-plover-git-2016-08-16.drv-0/plover-master
Processing ./plover-3.0.0-py2-none-any.whl
Invalid requirement: 'python-xlib>=0.16; linux in "sys_platform"'
Traceback (most recent call last):
  File "/nix/store/5m35jmz5h5jijfqi8002hc9vashpvwla-python-2.7.12-bootstrapped-pip-8.1.2/lib/python2.7/site-packages/pip/req/req_install.py", line 78, in __init__
    req = Requirement(req)
  File "/nix/store/5m35jmz5h5jijfqi8002hc9vashpvwla-python-2.7.12-bootstrapped-pip-8.1.2/lib/python2.7/site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
    requirement_string[e.loc:e.loc + 8]))
InvalidRequirement: Invalid requirement, parse error at "'; linux '"

when I try to install plover. It works when I downgrade to pip 8.1.1, but 8.1.2 is the one NixOS (unstable) uses (so the plover package is marked as broken for the time being on NixOS).

This seems relevant: https://github.com/pypa/pip/issues/3781 which seems to imply that they might fix the problem on pip, but perhaps there is a workaround/new syntax that would fix this as well? I have tried this against the master branch today.

Thank you,
Robert

Ted Morin

unread,
Aug 16, 2016, 2:04:04 PM8/16/16
to Plover
Maybe try replacing the quotes (") with apostrophes (') in the generated requirements.txt, does that solve the issue? If not, seems like it's just a regression that would need to be fixed by pip.

--
You received this message because you are subscribed to the Google Groups "Plover" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ploversteno+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kovacsics Róbert

unread,
Aug 16, 2016, 2:28:55 PM8/16/16
to Plover
On Tuesday, 16 August 2016 19:04:04 UTC+1, Ted Morin wrote:
Maybe try replacing the quotes (") with apostrophes (') in the generated requirements.txt, does that solve the issue? If not, seems like it's just a regression that would need to be fixed by pip.

Thanks, tried it (the file was called plover.egg-info/requires.txt) but it did not make any difference.

mattb...@gmail.com

unread,
Aug 27, 2016, 7:57:49 AM8/27/16
to Plover

 I get the same error when trying to install the wheel, but I do not get the message when I run


pip install --user -r requirements.txt


as suggested here: https://github.com/openstenoproject/plover/tree/master/linux


Note that I omit "-c requirements_constraints.txt" because that file does not exist in my folder after running

./setup.py write_requirements. Note also that I run "pip" instead of "pip2" (as suggested on that page), because when I run "pip2 install --user -r requirements.txt", I get the following error message:


Collecting wxPython>=3.0 (from -r requirements.txt (line 15))
  Could not find a version that satisfies the requirement wxPython>=3.0 (from -r requirements.txt (line 15)) (from versions: )
No matching distribution found for wxPython>=3.0 (from -r requirements.txt (line 15))


It works with pip (not pip2) as mentioned above though. Now I'm able to run ./launch.sh and am eager to try out Plover for the first time! Yay!

mattb...@gmail.com

unread,
Aug 27, 2016, 8:20:12 AM8/27/16
to Plover

I also tried the sed replacement, but there seems to be another requirements.txt that is called when creating the wheel. I couldn't find (sudo find / -name "requirements.txt") it though.

Kovacsics Róbert

unread,
Aug 27, 2016, 2:15:59 PM8/27/16
to Plover
Aha! I think syntax changed from

x in sys_platform

to

x == sys_platform

(or at least, the 'in' syntax got removed because of https://github.com/pypa/pip/issues/3624)
Reply all
Reply to author
Forward
0 new messages