NickPancakes opened a new issue #15768:
URL: https://github.com/apache/airflow/issues/15768


   **Apache Airflow version**: 2.0.2
   
   **Environment**:
   
   - **Hardware configuration**: Macbook Pro 2017
   - **OS**:  macOS X Catalina  10.15.7
   - **Kernel**: Darwin 19.6.0
   - **Others**: Docker 20.10.6, docker-compose 1.29.1
   
   **What happened**:
   
   Running the demo `example_python_operator` dag fails on the 
`virtualenv_python` step. The call to pip via subprocess fails:
   `subprocess.CalledProcessError: Command '['/tmp/venvt3_qnug6/bin/pip', 
'install', 'colorama==0.4.0']' returned non-zero exit status 1.`
   
   The error coming from pip is: `ERROR: Can not perform a '--user' install. 
User site-packages are not visible in this virtualenv.`
   
   **What you expected to happen**:
   
   The call to pip succeeds, and the colorama dependency is installed into the 
virtualenv without attempting to install to user packages. The 
`example_python_operator` dag execution succeeds.
   
   **How to reproduce it**:
   
   Setup airflow 2.0.2 in docker as detailed in the Quickstart guide: 
https://airflow.apache.org/docs/apache-airflow/stable/start/docker.html
   Once running, enable and manually trigger the `example_python_operator` dag 
via the webUI.
   The dag will fail at the `virtualenv_python` task.
   
   **Anything else we need to know**:
   
   Not a problem with the Airflow 2.0.1 docker-compose. Fairly certain this is 
due to the addition of the `PIP_USER` environment variable being set to `true` 
in this PR: https://github.com/apache/airflow/pull/14125
   
   My proposed solution would be to prepend `PIP_USER=false` to the 
construction of the call to pip within `utils/python_virtualenv.py` here: 
https://github.com/apache/airflow/blob/25caeda58b50eae6ef425a52e794504bc63855d1/airflow/utils/python_virtualenv.py#L30


-- 
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:
[email protected]


Reply via email to