You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/04/07 09:59:16 UTC

[GitHub] [airflow] mamilov opened a new issue #8172: Cannot import DAG => Expected in: flat namespace

mamilov opened a new issue #8172: Cannot import DAG => Expected in: flat namespace
URL: https://github.com/apache/airflow/issues/8172
 
 
   **Apache Airflow version**: `1.10.9`
   
   **Environment**:
   Cloud provider or hardware configuration: Hardware: MacBook Pro 16-inch
   OS (e.g. from /etc/os-release): MacOS 10.15.2
   Kernel (e.g. uname -a): Darwin Kernel Version 19.2.0
   Install tools: Pyenv & Pipenv
   Others: None
   Database: PostgreSQL
   
   **What happened**:
   
   I cannot import DAG into my project. When running `from airflow import DAG` I get an error.
   
   **What you expected to happen**:
   
   The expected behavior is that I'm able to import the DAG.  
   The error seems to come from the setproctitle lib. Just importing that with ` import setproctitle`  throws the same error.
   
   **How to reproduce it**:
   
   Just import the DAG with `from airflow import DAG`.
   
   **Anything else we need to know**:
   
   How often does this problem occur? Every time
   
   Any relevant logs to include? Put them here in side a detail tag:
   
   <details><summary>airflow_import_dag_error.log</summary>Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/Users/milov/.local/share/virtualenvs/dags-dwx8ai-u/lib/python3.7/site-packages/airflow/__init__.py", line 42, in <module>
       from airflow.models import DAG
     File "/Users/milov/.local/share/virtualenvs/dags-dwx8ai-u/lib/python3.7/site-packages/airflow/models/__init__.py", line 21, in <module>
       from airflow.models.baseoperator import BaseOperator, BaseOperatorLink  # noqa: F401
     File "/Users/milov/.local/share/virtualenvs/dags-dwx8ai-u/lib/python3.7/site-packages/airflow/models/baseoperator.py", line 43, in <module>
       from airflow.models.dag import DAG
     File "/Users/milov/.local/share/virtualenvs/dags-dwx8ai-u/lib/python3.7/site-packages/airflow/models/dag.py", line 46, in <module>
       from airflow.executors import LocalExecutor, get_default_executor
     File "/Users/milov/.local/share/virtualenvs/dags-dwx8ai-u/lib/python3.7/site-packages/airflow/executors/__init__.py", line 24, in <module>
       from airflow.executors.base_executor import BaseExecutor # noqa
     File "/Users/milov/.local/share/virtualenvs/dags-dwx8ai-u/lib/python3.7/site-packages/airflow/executors/base_executor.py", line 24, in <module>
       import airflow.utils.dag_processing
     File "/Users/milov/.local/share/virtualenvs/dags-dwx8ai-u/lib/python3.7/site-packages/airflow/utils/dag_processing.py", line 40, in <module>
       from setproctitle import setproctitle
   ImportError: dlopen(/Users/milov/.local/share/virtualenvs/dags-dwx8ai-u/lib/python3.7/site-packages/setproctitle.cpython-37m-darwin.so, 2): Symbol not found: _Py_GetArgcArgv
     Referenced from: /Users/milov/.local/share/virtualenvs/dags-dwx8ai-u/lib/python3.7/site-packages/setproctitle.cpython-37m-darwin.so
     Expected in: flat namespace
    in /Users/milov/.local/share/virtualenvs/dags-dwx8ai-u/lib/python3.7/site-packages/setproctitle.cpython-37m-darwin.so</details>
   
   <details><summary>setproctitle_import_error.log</summary>Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   ImportError: dlopen(/Users/milov/.local/share/virtualenvs/dags-dwx8ai-u/lib/python3.7/site-packages/setproctitle.cpython-37m-darwin.so, 2): Symbol not found: _Py_GetArgcArgv
     Referenced from: /Users/milov/.local/share/virtualenvs/dags-dwx8ai-u/lib/python3.7/site-packages/setproctitle.cpython-37m-darwin.so
     Expected in: flat namespace
    in /Users/milov/.local/share/virtualenvs/dags-dwx8ai-u/lib/python3.7/site-packages/setproctitle.cpython-37m-darwin.so</details>
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [airflow] boring-cyborg[bot] commented on issue #8172: Cannot import DAG => Expected in: flat namespace

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #8172: Cannot import DAG => Expected in: flat namespace
URL: https://github.com/apache/airflow/issues/8172#issuecomment-610294594
 
 
   Thanks for opening your first issue here! Be sure to follow the issue template!
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [airflow] ashb commented on issue #8172: setproctitle causes "Expected in: flat namespace" error

Posted by GitBox <gi...@apache.org>.
ashb commented on issue #8172: setproctitle causes "Expected in: flat namespace" error
URL: https://github.com/apache/airflow/issues/8172#issuecomment-610393339
 
 
   @mamilov Are you able to try a virtualenvironment outside of pyenv/pipenv please?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [airflow] mik-laj commented on issue #8172: Cannot import DAG => Expected in: flat namespace

Posted by GitBox <gi...@apache.org>.
mik-laj commented on issue #8172: Cannot import DAG => Expected in: flat namespace
URL: https://github.com/apache/airflow/issues/8172#issuecomment-610373124
 
 
   Related issue: https://github.com/apache/airflow/issues/8079

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [airflow] jdavidheiser commented on issue #8172: setproctitle causes "Expected in: flat namespace" error

Posted by GitBox <gi...@apache.org>.
jdavidheiser commented on issue #8172: setproctitle causes "Expected in: flat namespace" error
URL: https://github.com/apache/airflow/issues/8172#issuecomment-610401765
 
 
   I also ran into this on Mac OS Catalina, but while running in a Bazel build environment that should theoretically have some isolation from system Python.
   
   As a workaround, I was able to use Anaconda to install setproctitle and that worked.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [airflow] cboden edited a comment on issue #8172: setproctitle causes "Expected in: flat namespace" error

Posted by GitBox <gi...@apache.org>.
cboden edited a comment on issue #8172: setproctitle causes "Expected in: flat namespace" error
URL: https://github.com/apache/airflow/issues/8172#issuecomment-612027480
 
 
   I'm having this same problem. MacOS 10.15.3 with Python 3.7.6 installed via Homebrew inside a native venv (`python3 -m venv my-venv`). 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [airflow] cboden commented on issue #8172: setproctitle causes "Expected in: flat namespace" error

Posted by GitBox <gi...@apache.org>.
cboden commented on issue #8172: setproctitle causes "Expected in: flat namespace" error
URL: https://github.com/apache/airflow/issues/8172#issuecomment-612027480
 
 
   I'm having this same problem. MacOS 10.15.3 with Python 3.7.6 installed via Homebrew installed inside a native venv (`python3 -m venv my-venv`). 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services