Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to install wsgiref on Python 3

I have a problem installing wsgiref:

$ python --version
Python 3.6.0 :: Anaconda 4.3.1 (x86_64)
$ pip --version
pip 9.0.1 from /anaconda/lib/python3.6/site-packages (python 3.6)

My requirement.txt file are shown as below.

numpy==1.8.1
scipy==0.14.0
pyzmq==14.3.1
pandas==0.14.0
Jinja2==2.7.3
MarkupSafe==0.23
backports.ssl-match-hostname==3.4.0.2
gnureadline==6.3.3
ipython==2.1.0
matplotlib==1.3.1
nose==1.3.3
openpyxl==1.8.6
patsy==0.2.1
pyparsing==2.0.2
python-dateutil==2.2
pytz==2014.4
scikit-learn==0.14.1
six==1.7.3
tornado==3.2.2
wsgiref==0.1.2
statsmodels==0.5.0

when I run pip install -r requirement.txt, I got this error

Collecting wsgiref==0.1.2 (from -r requirements.txt (line 20))
  Using cached wsgiref-0.1.2.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/xs/y0pbzxkn7gqcdtrz4cpxtwrw0000gn/T/pip-build-hkiqbu1j/wsgiref/setup.py", line 5, in <module>
        import ez_setup
      File "/private/var/folders/xs/y0pbzxkn7gqcdtrz4cpxtwrw0000gn/T/pip-build-hkiqbu1j/wsgiref/ez_setup/__init__.py", line 170
        print "Setuptools version",version,"or greater has been installed."
                                 ^
    SyntaxError: Missing parentheses in call to 'print'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/xs/y0pbzxkn7gqcdtrz4cpxtwrw0000gn/T/pip-build-hkiqbu1j/wsgiref/

I have tried to run pip install --upgrade setuptools and sudo easy_install -U setuptools but neither works. How can I solve this problem?

like image 761
Joey Yi Zhao Avatar asked Mar 26 '17 09:03

Joey Yi Zhao


1 Answers

wsgiref is already been included as a standard library in Python 3... So in case if you are trying with Python 3 just go ahead and import wsgiref thats it.

like image 161
Aneesh Damodaran Avatar answered Sep 21 '22 21:09

Aneesh Damodaran