1
pip install urlparse4
Collecting urlparse4
  Using cached urlparse4-0.1.3.tar.gz (158 kB)
    ERROR: Command errored out with exit status 1:
     command: /opt/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/5d/s05y8m4107z_tgvnq4z02kdr0000gp/T/pip-install-4dhc591p/urlparse4/setup.py'"'"'; __file__='"'"'/private/var/folders/5d/s05y8m4107z_tgvnq4z02kdr0000gp/T/pip-install-4dhc591p/urlparse4/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 /private/var/folders/5d/s05y8m4107z_tgvnq4z02kdr0000gp/T/pip-pip-egg-info-me23x0q2
         cwd: /private/var/folders/5d/s05y8m4107z_tgvnq4z02kdr0000gp/T/pip-install-4dhc591p/urlparse4/
    Complete output (6 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/5d/s05y8m4107z_tgvnq4z02kdr0000gp/T/pip-install-4dhc591p/urlparse4/setup.py", line 46
        print "urlparse4/gurl.cpp not found and Cython failed to run to recreate it. Please install/upgrade Cython and try again."
                                                                                                                                 ^
    SyntaxError: Missing parentheses in call to 'print'. Did you mean print("urlparse4/gurl.cpp not found and Cython failed to run to recreate it. Please install/upgrade Cython and try again.")?
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Dears, what caused this problem and I can I resolve it? Many thanks in advance!

Python Newbie
  • 317
  • 2
  • 9

1 Answers1

1

The urlparse module only supports Python2.7. (See https://pypi.org/project/urlparse4/)

In Python3, you should use urllib.parse instead:

import urllib.parse

More info: How can i import urlparse in python-3?

adamgy
  • 4,543
  • 3
  • 16
  • 31