小编Kar*_*hik的帖子

运行时错误:GnuPG 未安装

要求:运行python解密文件

我已经在 MacOS 的虚拟环境中安装了 gnupg,也import gnupg可以正常工作,但第二行抛出错误,如下所示

>>> gpg = gnupg.GPG() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/.local/share/virtualenvs/mypython-sPLN-T2A/lib/python3.8/site-packages/gnupg/gnupg.py", line 117, in __init__ super(GPG, self).__init__( File "/Users/.local/share/virtualenvs/mypython-sPLN-T2A/lib/python3.8/site-packages/gnupg/_meta.py", line 182, in __init__ self.binary = _util._find_binary(binary) File "/Users/.local/share/virtualenvs/mypython-sPLN-T2A/lib/python3.8/site-packages/gnupg/_util.py", line 429, in _find_binary raise RuntimeError("GnuPG is not installed!") RuntimeError: GnuPG is not installed!

代码

import gnupg
gpg = gnupg.GPG()
Run Code Online (Sandbox Code Playgroud)

解决方案:

我终于能够解决这个问题了

  1. 安装中brew install GnuPG
  2. 导入 gnupg gpg = gnupg.GPG('/usr/local/bin/gpg')

gnupg python-3.x

5
推荐指数
1
解决办法
8148
查看次数

Airflow:Docker-Compose:“您正在以 root 身份运行 pip 请使用用户来运行 pip”

要求:使用官方 docker-compose 和 Airflow 版本 2.3.0 运行本地 Airflow 问题:“You are running pip as root Please use user to run pip”

Airflow 版本 2.3.0 操作系统 - macOS

我可以在 2.2.4 上正常运行,但在 2.3.0 上不行

在运行之前也运行了以下命令docker-compose up airflow-init

mkdir -p ./dags ./logs ./plugins
echo -e "AIRFLOW_UID=$(id -u)" > .env
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

Docker-Compose curl -LfO 'https://airflow.apache.org/docs/apache-airflow/2.3.0/docker-compose.yaml'

docker-compose airflow airflow-2.x

4
推荐指数
1
解决办法
7179
查看次数

SQL:在退货期之前检查日期是否按时付款

SQL:检查付款日期是否在退货期后下个月的19号之前

\n

要求是确定OnTime Payment \'Y\'/\'N\'

\n
\xe2\x80\xa2 If monthly = PAID before the 19th of the month following the return period\nExample: Jan-Jan payment deadline = Feb 19\n\xe2\x80\xa2 If quarterly = paid before the 16th of the 2nd month following the return period\nExample: Jan-Mar payment deadline = May 16\n\xe2\x80\xa2 If last quarterly = paid before the 30th of the month following the return period\nExample: Oct-Dec payment deadline = Jan 30\n
Run Code Online (Sandbox Code Playgroud)\n

对于季度,如果是最后一个季度,则在下个月的 30 日支付,对于季度月的其余时间,则在该月的 16 日支付

\n
with data as (\n …
Run Code Online (Sandbox Code Playgroud)

sql snowflake-cloud-data-platform

3
推荐指数
1
解决办法
91
查看次数

Terraform:MacOS:zsh: 执行格式错误:terraform

我第一次安装brew install terraform并且运行良好但后来我尝试安装特定版本,如下所示

wget -P terraform_bin/ https://releases.hashicorp.com/terraform/0.12.0/terraform_0.12.0_linux_amd64.zip
unzip -o terraform_bin/terraform_0.12.0_linux_amd64.zip -d terraform_bin/
mv terraform_bin/terraform /usr/local/bin
rm -rf terraform_bin
terraform version
Run Code Online (Sandbox Code Playgroud)

但现在它在 MacOS 中的安装变得混乱,当尝试运行版本时它失败了

在此输入图像描述

macos zsh oh-my-zsh terraform

-1
推荐指数
1
解决办法
1万
查看次数