0

1)Import rpyc not working in azure web service python flask application, Its shows "Application Error If you are the application administrator, you can access the diagnostic resources."

2)How to insall rpyc in azure app service with flask application?

Please help

Karthik.M
  • 67
  • 11

1 Answers1

0

Here is something what you can do:

  • Create requirement.txt file with all your dependent libraries, simple declaration would be in your txt file like below:

    beautifulsoup4  ==4.8.1
    bs4             ==0.0.1
    Click           ==7.0
    cycler          ==0.10.0
    django-cors     ==0.1
    Flask           ==1.1.1
  • Create .venv file under your root folder with below values:

    FLASK_APP=StartupFile.py
    FLASK_ENV=development
  • Once you deployed the solution , open the KUDU app of your azure portal:

enter image description here

  • You can open the BASH and browse the directory which would be wwwroot:

enter image description here

  • Execute the command in below order:

   python3 -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
    export FLASK_APP=application.py
    flask run

Similarly your module will be installed in the virtual environment. Add the dependency in your requirement.txt.

Additional reference:

https://jackstromberg.com/2018/07/installing-python-wheel-files-on-an-azure-app-service/

Hope it helps.

Mohit Verma
  • 5,140
  • 2
  • 12
  • 27
  • Hi Mohit Verma, Its working fine. I want to run rpyc_classic.py In bash file, After running, its shows the error "no module named rpyc". So I tried to pip install rpyc.. Its keep on asking Cleaning up.... Pls help. – Karthik.M Jan 10 '20 at 09:11
  • refresh your Bash command window , browse through wwwroot and try installing the file using wheel file like : pip install --use-wheel pillow and pip install (file name).whl , should be installed then – Mohit Verma Jan 10 '20 at 11:35
  • For installing wheel library , you have to run first pip install wheel and then you can execute pip install (file name).whl – Mohit Verma Jan 10 '20 at 11:37
  • Hi Mohit, After pip install wheel getting below exception.. .. no such option: --use-wheel Usage: pip install [options] [package-index-options] ... pip install [options] -r [package-index-options] ... pip install [options] [-e] ... pip install [options] [-e] ... pip install [options] ... no such option: --use-wheel – Karthik.M Jan 13 '20 at 05:56
  • Check this link for installing libraries in Azure linux. It will guide you to install libraries using wheel – Mohit Verma Jan 13 '20 at 06:02
  • Alternatively after activating venv try executing pip wheel -r requirements.txt -w wheelhouse. It works – Mohit Verma Jan 13 '20 at 06:08
  • Thanks. Can you give me in which link to proceed to install wheel libraries? – Karthik.M Jan 13 '20 at 06:29
  • https://jackstromberg.com/2018/07/installing-python-wheel-files-on-an-azure-app-service/ – Mohit Verma Jan 13 '20 at 06:33
  • Please mark it as answer as it will help other who have the same ask. – Mohit Verma Jan 13 '20 at 13:07
  • sorry Mohit.., still facing no such option exception, while pip install wheel. – Karthik.M Jan 17 '20 at 09:04