docker-airflow
docker-airflow copied to clipboard
flask_bcrypt install failed
pip list don't have flask-bcrypt despite the fact that requirement.txt have flask_bcrypt. So, how to fix?
I added flask_bcrypt to my requirement.txt file without any problem.
Have you already tried to install it manually by going into de airflow-docker itself and executing 'pip install flask_bcrypt' or 'pip install flask-bcrypt'? What was the result?
Yes,I installed it and it worked. but i just want to know that why can't install my requirement.txt
-
Maybe a typo ? I now see in your post that you mentioned requirement.txt while it should be requirements.txt
-
Did you mount the requirements file? Airflow needs to have the requirements.txt file inside the docker. I have added the following option using docker run : -v /airflow/requirements.txt:/requirements.txt
Yes, I did and when I use docker run, it showed result that flask_bcrypt was installed but don't have in pip list. so, I can't use password extra package to authentication.
airflow:
image: puckel/docker-airflow:latest
container_name: airflow
volumes:
- ./airflow/config/airflow.cfg:/usr/local/airflow/airflow.cfg
- ./airflow/config/requirements.txt:/requirements.txt
- ./airflow/dags:/usr/local/airflow/dags
this result that flack_bcrypt was installed
airflow | Requirement already satisfied: defusedxml in /usr/local/lib/python3.7/site-packages (from python3-openid>=2.0->Flask-OpenID<2,>=1.2.5->flask-appbuilder~=2.2; python_version >= "3.6"->apache-airflow[password]->-r /requirements.txt (line 1)) (0.6.0)
airflow | Building wheels for collected packages: flask-bcrypt
airflow | Building wheel for flask-bcrypt (setup.py): started
airflow | Building wheel for flask-bcrypt (setup.py): finished with status 'done'
airflow | Created wheel for flask-bcrypt: filename=Flask_Bcrypt-0.7.1-py3-none-any.whl size=5010 sha256=a05c3e379fb5ad60672b275d18a93b218b6f874ba94a204ee823429fc1ceb77f
airflow | Stored in directory: /usr/local/airflow/.cache/pip/wheels/ba/fe/43/659919277d75dff2d7f32ef221eefa4d2fb1559b42600339c2
airflow | Successfully built flask-bcrypt
airflow | Installing collected packages: flask-bcrypt
airflow | Successfully installed flask-bcrypt-0.7.1
airflow | WARNING: You are using pip version 20.0.2; however, version 20.2.4 is available.
airflow | You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
Have you made any changes to the original Dockerfile and/or build your own?
Maybe there is something wrong as which user the requirements are installed or which user starts airflow. The puckel dockerfile adds a linux user 'airflow'. In the original Dockerfile the general installation of airflow and the needed packages are installed first. Then the user 'airflow' is activated and it will execute the entrypoint.sh script which will install the requirements.txt file. Finally the user 'airflow' will run airfow.
When I execute pip list as the user airflow :
docker exec -u airflow -it airflow pip list
the package flask-bcrypt is installed for that user
When I execute pip list for the root user :
docker exec -u 0 -it airflow pip list No flask-bcrypt is available for that user.
I wanted to customize the puckel dockerfile but that was not that successful. So I made a new dockerfile starting with the puckel-image and added what I needed (in my case Jupyter notebook and ffmpeg). If you are interested I have attached my Dockerfile and entrypoint.sh . This works when adding the requirements.