-2

I am not able to install wsgiref in ubuntu, I tried to install it with 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.```
Dev Doshi
  • 160
  • 2
  • 12

1 Answers1

1

wsgiref doesn't support your Python version

You have to use Python 2 and Pip 3, for more information read this

"This is a standalone release of the wsgiref library, that provides validation support for WSGI 1.0.1 (PEP 3333) for Python versions < 3.2, and includes the new wsgiref.util.test() utility function."

This is the solution from the Github issue:

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).

Dev Doshi
  • 160
  • 2
  • 12