0

In the following hour's i tried to deploy Python with flask on Microsoft azure platform.

I used New app "flask", assign with their server. deployed by git. after deployment finished (its showed Unable to find vcvarsall.bat) Then I set up on options that i am using python 3.4 version and it fixed it up.

After Deployment succeeds I tried to see the site and I got : Failed to load resource: the server responded with a status of 500 (Internal Server Error)

I am a beginner in deploying and I search up all over. I really wish somebody could help me find the right answer.

Thank you very much.

3
  • 1
    Woule you please post more details of Internal Server Error ExceptionTrace log to let me help you? You could find logs in Kudu. Commented Aug 28, 2017 at 5:30
  • This is the python Logs : error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from aka.ms/vcpython27 (file).read().replace('\r\n', '\n'), file, 'exec'))" install --record d:\local\temp\pip-pychep-record\install-record.txt --single-version-externally-managed --compile --install-headers D:\home\site\wwwroot\env\include\site\python2.7 failed with error code 1 in D:\home\site\wwwroot\env\build\lxml I fixed it up by using the Python 3.4 on settings, maybe I shouldn't go with that? Commented Aug 28, 2017 at 15:01
  • running build_ext building 'lxml.etree' extension error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from aka.ms/vcpython27 This is the error from the deploy Commented Aug 28, 2017 at 21:56

1 Answer 1

1

Based on my research on this blog which mentioned content below about your issue:

When you see "unable to find vcvarsall.bat", it means you're installing a package that has an extension module, but only the source code. "vcvarsall.bat" is part of the compiler in Visual Studio that is necessary to compile the module.

I think your issue occurred because that during the flask project deployed to azure, pip has problems installing the lxml library.As mentioned in this document, lxml library is written in C which requires a compiler before it's installation.

Unfortunately,a compiler is not available on the machine running the web app in Azure App Service. So, you need to do this compilation locally. You can follow the steps as below:

Step 1:Use pip wheel command line to generate .whl file of lxml package.In addition,you can directly download generated .whl file here.

enter image description here

Step2:Create the wheelhouse folder under the requments.txt file's sibling directory and put the .whl file in wheelhouse folder.

Step3: Edit your requirements.txt to add the --find-links option at the top.

--find-links wheelhouse
lxml==3.8.0

Step4:Deploy your flask project to azure.

For more details , please refer to the Troubleshooting - Package Installation chapter in the official document and wheel document.

Hope it helps you.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.