2

I'm on Ubuntu 14.04 and have both python 2.7 and 3.4 installed in my system. I was trying to install python's unirest using pip. But it returns the following error.

>> [sudo] pip install unirest
Collecting unirest
  Using cached Unirest-1.1.7.tar.gz
Collecting poster>=0.8.1 (from unirest)
  Using cached poster-0.8.1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-7ur_3q0v/poster/setup.py", line 2, in <module>
        import poster
      File "/tmp/pip-build-7ur_3q0v/poster/poster/__init__.py", line 29, in <module>
        import poster.streaminghttp
      File "/tmp/pip-build-7ur_3q0v/poster/poster/streaminghttp.py", line 61
        print "send:", repr(value)
                    ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-7ur_3q0v/poster/
>>

I also tried the solution here "pip fails to install anything, error: invalid command 'egg_info'", but it did not work.

Please help

Community
  • 1
  • 1
Sherbert
  • 23
  • 6
  • Are you sure it is python-2.x that is the default python version? something tells me Python 3 is your default version – Aswin Murugesh Jun 15 '16 at 11:29
  • The problem was my pip default version read pip 8.1.2 from /usr/local/lib/python3.4/dist-packages/pip-8.1.2-py3.4.egg (python 3.4) sudo pip2 install unirest returned successfully installed unirest. But when i import unirest in python I get a different error from email.Utils import parsedate_tz ImportError: cannot import name parsedate_tz – Sherbert Jun 15 '16 at 11:31
  • Was there any resolution to this? I'm having same error. Using python 3.7. – ikwyl6 Apr 09 '19 at 01:56

0 Answers0