首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在python 3.x中安装wsgiref

无法在python 3.x中安装wsgiref
EN

Stack Overflow用户
提问于 2019-12-25 04:51:42
回答 1查看 1.4K关注 0票数 5

我不能在python 3中安装wsgiref。我得到了这些错误。我正在使用Python3,但是我不能安装wsgiref,我尝试过pip install wsgirefpip install wsgiref==0.1.2

代码语言:javascript
复制
E:\CodeWork\Machine Learning\SWATI-The-Assistant-master\SWATI-The-Assistant-master>pip install wsgiref==0.1.2
Collecting wsgiref==0.1.2
  Using cached https://files.pythonhosted.org/packages/41/9e/309259ce8dff8c596e8c26df86dbc4e848b9249fd36797fd60be456f03fc/wsgiref-0.1.2.zip
    ERROR: Command errored out with exit status 1:
     command: 'c:\program files\python37\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\hp\\AppData\\Local\\Temp\\pip-install-h2ydr_0e\\wsgiref\\setup.py'"'"'; __file__='"'"'C:\\Users\\hp\\AppData\\Local\\Temp\\pip-install-h2ydr_0e\\wsgiref\\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 'C:\Users\hp\AppData\Local\Temp\pip-install-h2ydr_0e\wsgiref\pip-egg-info'
         cwd: C:\Users\hp\AppData\Local\Temp\pip-install-h2ydr_0e\wsgiref\
    Complete output (8 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\hp\AppData\Local\Temp\pip-install-h2ydr_0e\wsgiref\setup.py", line 5, in <module>
        import ez_setup
      File "C:\Users\hp\AppData\Local\Temp\pip-install-h2ydr_0e\wsgiref\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.```
EN

回答 1

Stack Overflow用户

发布于 2020-05-29 00:33:27

Pip3安装出错的原因是安装过程中的一条print语句的语法是没有括号的旧python 2样式。好消息是,默认情况下,wsgiref已经包含在python3库中。启动python 3 shell并尝试输入'import wsgiref',应该不会出现错误。

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59473303

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档