python - pip install terraform_utils 失败
问题描述
尝试在 Mac 上的 python 2.7 上使用 pip 安装 terraform_utils。
ERROR: Command errored out with exit status 1:
command: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-p0O4_9/terraform-utils/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-p0O4_9/terraform-utils/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/tmp/pip-pip-egg-info-30t_an
cwd: /private/tmp/pip-install-p0O4_9/terraform-utils/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-install-p0O4_9/terraform-utils/setup.py", line 8
def read_file(path: Union[str, Path]) -> str:
^
SyntaxError: invalid syntax
----------------------------------------
错误:命令出错,退出状态为 1:python setup.py egg_info 检查日志以获取完整的命令输出。
任何人都可以帮助解决上述错误吗?无法弄清楚缺少什么!
解决方案
看起来您正在使用 Python2.7 运行此代码,但它仅受 Python 3.5+ 支持。此语法是指静态类型,更多信息在这里:
推荐阅读
- python - Numpy 数组限制操作 X[X < {value}] = {value}
- java - 如何解析可能是字符串并且可能是杰克逊数组的字段
- python-3.x - 将日期时间插入数据库
- node.js - 在没有类的情况下对 html 表进行刮擦和迭代
- python - 在 Python 中使用 pathlib ( \u2069 ) 获取文件夹错误
- python - 使用 NRF24L01 将 Arduino 浮点值转换为 Python
- regex - 使用 wget 和 grep 从页面中提取超链接
- elixir - 如何在设备神经上复制crt文件
- assembly - Objdump 在已编译的程序集中将 fsubrp 交换为 fsubp?
- python - 查找具有给定长度的“运行”的十进制字符串的数量