使用 pip 安装 pynput

使用 pip 安装 pynput

尝试使用 pip 安装 pynput 时出现以下错误:

Invalid requirement: 'python-xlib>=0.17; linux in "sys_platform"'
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 78, in __init__
    req = Requirement(req)
  File "/usr/share/python-wheels/packaging-16.6-py2.py3-none-any.whl/packaging/requirements.py", line 94, in __init__
    requirement_string[e.loc:e.loc + 8]))
InvalidRequirement: Invalid requirement, parse error at "'; linux '"

我怎样才能消除这个错误?

答案1

这对我有用,你可以试试这个..(适用于 python 2.7)

$ sudo -H python -m pip install --upgrade pip setuptools wheel
$ sudo -H pip install xlib
$ sudo -H pip install xlib>=0.17
$ sudo -H pip install pynput

相关内容