【问题标题】:There was an error while I tried to install urlparse4我尝试安装 urlparse4 时出错
【发布时间】:2020-05-31 15:51:23
【问题描述】:
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.

亲爱的,是什么导致了这个问题,我可以解决它吗?非常感谢!

【问题讨论】:

    标签: python-3.x


    【解决方案1】:

    urlparse 模块仅支持 Python2.7。 (见https://pypi.org/project/urlparse4/

    在 Python3 中,您应该改用 urllib.parse

    import urllib.parse
    

    更多信息:How can i import urlparse in python-3?

    【讨论】:

      猜你喜欢
      • 2018-10-21
      • 1970-01-01
      • 1970-01-01
      • 2017-09-15
      • 2017-10-11
      • 2015-01-17
      • 2013-11-13
      • 2018-03-05
      • 2015-12-18
      相关资源
      最近更新 更多