我无法在ubuntu中安装wsgiref

2024-10-02 20:34:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我无法在ubuntu中安装wsgiref,我尝试用pip安装它

pip3 install wsgiref
Defaulting to user installation because normal site-packages is not writeable
Collecting wsgiref
  Using cached wsgiref-0.1.2.zip (37 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8_gcoo21/wsgiref_7a9633f256d6441e8608f2e540e51c18/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8_gcoo21/wsgiref_7a9633f256d6441e8608f2e540e51c18/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-bmlvfwrd
         cwd: /tmp/pip-install-8_gcoo21/wsgiref_7a9633f256d6441e8608f2e540e51c18/
    Complete output (8 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-8_gcoo21/wsgiref_7a9633f256d6441e8608f2e540e51c18/setup.py", line 5, in <module>
        import ez_setup
      File "/tmp/pip-install-8_gcoo21/wsgiref_7a9633f256d6441e8608f2e540e51c18/ez_setup/__init__.py", line 170
        print "Setuptools version",version,"or greater has been installed."
              ^
    SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Setuptools version",version,"or greater has been installed.")?
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.```

Tags: installpipinpyinfoeggversionsetup
1条回答
网友
1楼 · 发布于 2024-10-02 20:34:04

wsgiref不支持您的Python版本

您必须使用Python2和PIP3,有关更多信息,请阅读this

“这是wsgiref库的独立版本,为Python版本<;3.2的WSGI 1.0.1(PEP 3333)提供验证支持,并包括新的wsgiref.util.test()实用程序函数。”

这是Github问题的解决方案:

There are a few fixes that will get you running, in order of least work to most:

  1. Switch over to python2.7 for your will installs.

  2. Try to upgrade wsgiref with pip install upgrade wsgiref, and see if the latest version works with your setup, and with will (if it doesn't, you'd notice the http/webhooks stuff not working.

  3. If you try 2) and it works, submit a PR here with the upgraded version in requirements.txt. (You can find out what versions you've got by using pip freeze).

相关问题 更多 >