AirFlow中的导入错误| Python |找不到符号:_Py_GetArgcArgv | Mac OS

问题描述 投票:0回答:1

我在终端中键入airflow vesrion命令时收到此错误。我在虚拟环境中从pip安装气流。

Traceback (most recent call last):
  File "/Users/subham.polpagedar/Desktop/celery_task/venv_celery/bin/airflow", line 25, in <module>
    from airflow.configuration import conf
  File "/Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/airflow/__init__.py", line 42, in <module>
    from airflow.models import DAG
  File "/Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/airflow/models/__init__.py", line 21, in <module>
    from airflow.models.baseoperator import BaseOperator, BaseOperatorLink  # noqa: F401
  File "/Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/airflow/models/baseoperator.py", line 43, in <module>
    from airflow.models.dag import DAG
  File "/Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/airflow/models/dag.py", line 46, in <module>
    from airflow.executors import LocalExecutor, get_default_executor
  File "/Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/airflow/executors/__init__.py", line 24, in <module>
    from airflow.executors.base_executor import BaseExecutor # noqa
  File "/Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/airflow/executors/base_executor.py", line 24, in <module>
    import airflow.utils.dag_processing
  File "/Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/airflow/utils/dag_processing.py", line 40, in <module>
    from setproctitle import setproctitle
ImportError: dlopen(/Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/setproctitle.cpython-37m-darwin.so, 2): Symbol not found: _Py_GetArgcArgv
  Referenced from: /Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/setproctitle.cpython-37m-darwin.so
  Expected in: flat namespace
 in /Users/subham.polpagedar/Desktop/celery_task/venv_celery/lib/python3.7/site-packages/setproctitle.cpython-37m-darwin.so
python macos airflow importerror
1个回答
0
投票

我在macOS上遇到了类似的问题。事实证明,这与通过brew安装的python有关。

如果可以,请尝试从python官方网站使用此版本:https://www.python.org/downloads/

并使用您的虚拟环境库作为您刚刚下载的版本。

希望有帮助

© www.soinside.com 2019 - 2024. All rights reserved.