python - 我无法在 ubuntu 中安装 wsgiref
问题描述
我无法在 ubuntu 中安装 wsgiref,我尝试使用 pip 安装它。
pip3 install wsgiref
Defaulting to user installation because normal site-packages is not writeable
Collecting wsgiref
Using cached wsgiref-0.1.2.zip (37 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8_gcoo21/wsgiref_7a9633f256d6441e8608f2e540e51c18/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8_gcoo21/wsgiref_7a9633f256d6441e8608f2e540e51c18/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 /tmp/pip-pip-egg-info-bmlvfwrd
cwd: /tmp/pip-install-8_gcoo21/wsgiref_7a9633f256d6441e8608f2e540e51c18/
Complete output (8 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-8_gcoo21/wsgiref_7a9633f256d6441e8608f2e540e51c18/setup.py", line 5, in <module>
import ez_setup
File "/tmp/pip-install-8_gcoo21/wsgiref_7a9633f256d6441e8608f2e540e51c18/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.```
解决方案
wsgiref 不支持你的 Python 版本
您必须使用 Python 2 和 Pip 3,有关更多信息,请阅读此
“这是 wsgiref 库的独立版本,它为 Python 版本 < 3.2 的 WSGI 1.0.1 (PEP 3333) 提供验证支持,并包括新的 wsgiref.util.test() 实用程序函数。”
这是Github问题的解决方案:
有一些修复可以让你运行,按照最少的工作到大多数:
切换到 python2.7 进行安装。
尝试使用 pip install --upgrade wsgiref 升级 wsgiref,并查看最新版本是否适用于您的设置,以及是否适用(如果不适用,您会注意到 http/webhooks 的东西不起作用。
如果您尝试 2) 并且有效,请在此处提交 PR,并在 requirements.txt 中使用升级版本。(您可以使用 pip freeze 找出您拥有的版本)。
推荐阅读
- excel - 导出到 Excel 时出现 SSRS 时间格式问题
- css - 如何在反应类组件中使用 react-jss?
- azure-pipelines - 我的海龟发布频道出了什么问题?
- mongodb - MongoDB在Go中列出具有给定前缀的数据库
- javascript - 如何针对 Android 和 IOS 优化此 CSS 代码?
- javascript - 我必须将闪烁的管道添加到特定的占位符中
- excel - 由于依赖问题,无法使用 spark-excel 导出数据框
- reactjs - 如何将 WP API 中的锚链接转换为 Next.js
使用 `dangerouslySetInnerHTML` - apache-spark-sql - Java Spark Sql添加列与2个单元格的总和
- flutter - 按下按钮返回未来的建设者