potiuk commented on issue #32879:
URL: https://github.com/apache/airflow/issues/32879#issuecomment-1657978382

   I also could not reproduce it. I run the same DAG as @hussein-awala and it 
correctly installed openpyxl and did not uninstall it in the worker "main" 
environment.
   
   ```
   [2023-07-31, 09:07:56 UTC] {process_utils.py:182} INFO - Executing cmd: 
/usr/local/bin/python -m virtualenv /tmp/venvz82thpo8 --system-site-packages
   [2023-07-31, 09:07:56 UTC] {process_utils.py:186} INFO - Output:
   [2023-07-31, 09:07:57 UTC] {process_utils.py:190} INFO - created virtual 
environment CPython3.8.17.final.0-64 in 286ms
   [2023-07-31, 09:07:57 UTC] {process_utils.py:190} INFO -   creator 
CPython3Posix(dest=/tmp/venvz82thpo8, clear=False, no_vcs_ignore=False, 
global=True)
   [2023-07-31, 09:07:57 UTC] {process_utils.py:190} INFO -   seeder 
FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, 
via=copy, app_data_dir=/home/airflow/.local/share/virtualenv)
   [2023-07-31, 09:07:57 UTC] {process_utils.py:190} INFO -     added seed 
packages: pip==23.2, setuptools==68.0.0, wheel==0.40.0
   [2023-07-31, 09:07:57 UTC] {process_utils.py:190} INFO -   activators 
BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
   [2023-07-31, 09:07:57 UTC] {process_utils.py:182} INFO - Executing cmd: 
/tmp/venvz82thpo8/bin/pip install -r /tmp/venvz82thpo8/requirements.txt
   [2023-07-31, 09:07:57 UTC] {process_utils.py:186} INFO - Output:
   [2023-07-31, 09:07:58 UTC] {process_utils.py:190} INFO - Collecting 
openpyxl==3.0.10 (from -r /tmp/venvz82thpo8/requirements.txt (line 1))
   [2023-07-31, 09:07:58 UTC] {process_utils.py:190} INFO -   Downloading 
openpyxl-3.0.10-py2.py3-none-any.whl (242 kB)
   [2023-07-31, 09:07:58 UTC] {process_utils.py:190} INFO -      
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 242.1/242.1 kB 5.7 MB/s eta 0:00:00
   [2023-07-31, 09:07:58 UTC] {process_utils.py:190} INFO - Requirement already 
satisfied: et-xmlfile in /home/airflow/.local/lib/python3.8/site-packages (from 
openpyxl==3.0.10->-r /tmp/venvz82thpo8/requirements.txt (line 1)) (1.1.0)
   [2023-07-31, 09:08:01 UTC] {process_utils.py:190} INFO - Installing 
collected packages: openpyxl
   [2023-07-31, 09:08:01 UTC] {process_utils.py:190} INFO -   Attempting 
uninstall: openpyxl
   [2023-07-31, 09:08:01 UTC] {process_utils.py:190} INFO -     Found existing 
installation: openpyxl 3.1.2
   [2023-07-31, 09:08:01 UTC] {process_utils.py:190} INFO -     Not 
uninstalling openpyxl at /home/airflow/.local/lib/python3.8/site-packages, 
outside environment /tmp/venvz82thpo8
   [2023-07-31, 09:08:01 UTC] {process_utils.py:190} INFO -     Can't uninstall 
'openpyxl'. No files were found to uninstall.
   [2023-07-31, 09:08:01 UTC] {process_utils.py:190} INFO - Successfully 
installed openpyxl-3.0.10
   [2023-07-31, 09:08:01 UTC] {process_utils.py:190} INFO - 
   [2023-07-31, 09:08:01 UTC] {process_utils.py:190} INFO - [notice] A new 
release of pip is available: 23.2 -> 23.2.1
   [2023-07-31, 09:08:01 UTC] {process_utils.py:190} INFO - [notice] To update, 
run: python -m pip install --upgrade pip
   [2023-07-31, 09:08:01 UTC] {process_utils.py:182} INFO - Executing cmd: 
/tmp/venvz82thpo8/bin/python /tmp/venvz82thpo8/script.py 
/tmp/venvz82thpo8/script.in /tmp/venvz82thpo8/script.out 
/tmp/venvz82thpo8/string_args.txt /tmp/venvz82thpo8/termination.log
   [2023-07-31, 09:08:01 UTC] {process_utils.py:186} INFO - Output:
   [2023-07-31, 09:08:01 UTC] {taskinstance.py:829} DEBUG - Refreshing 
TaskInstance <TaskInstance: venv_dag.test_venv 
manual__2023-07-31T09:07:55.967888+00:00 [running]> from DB
   ```
   
   After it was run:
   
   ```
   airflow@airflow-worker-0:/opt/airflow/dags$ pip freeze | grep openpyx
   openpyxl==3.1.2
   ```
   
   You need to explain in detail what is your configuration and show some logs 
of what's happening - my guess is that you likely manually updated openpyxl. 
You need to try again. 
   
   Converting it into discussion - this does not seem like an Airflow bug.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to