我面临的问题到目前为止都是可以管理的。在我的 conda 环境中安装本地包后,我需要添加一个标志来运行项目中的任何脚本,例如简单的数据提取脚本:
一开始还好;后来就这样了。我刚刚添加了标志,开发仍在继续。当我在 Airflow 中实现 DAG 时,问题就开始了,像
sh airflow dags list
这样的简单命令停止工作:
我记得这个问题是在我通过运行更新本地软件包后开始的:
python setup.py build
python setup.py install
在为此奋斗了一整天之后,我休息了一下,今天重新审视了它。我创建了一个新环境并重新安装了 Airflow,这使得
airflow dags list
按预期工作:
但是,我仍然没有找到解决方案,我怀疑它阻止我触发我的 DAG。有人可以帮忙吗?
如果需要,我会提供我的
setup.py
:
from setuptools import setup, find_packages
from pathlib import Path
import os
project_dir = Path(__file__).resolve().parent.resolve().parent.resolve().parent
presets_dir = os.path.abspath(os.path.join(os.path.pardir, 'python'))
reqs = project_dir.joinpath("requirements.txt").read_text().splitlines()
print(project_dir.joinpath("requirements.txt"))
setup(
name="fila-espera-pkg",
version="v1.0.0",
description="Module and packages used in the queue waiting project",
long_description=project_dir.joinpath("README.md").read_text(),
long_description_content_type="text/markdown",
author="Lucas Vital",
author_email="[email protected]",
license="MIT License",
packages=find_packages(exclude=("assets", "scripts/python/notebooks")),
install_requires=reqs,
classifiers=[
"Intended Audience :: Science/Research",
],
package_dir={'listaespera': 'listaespera'},
package_data={},
zip_safe=False
)
能够运行我的 python 脚本,而无需不需要的标志要求,并在我的 python 环境中运行气流命令,而不会出现任何问题