0
votes

Could you please help me with the following error? I am trying to deploy a web app to Azure and I encounter the following issue:

Even if by requirements, a newer version of setuptools is installed, the deployment fails with the error:" RuntimeError: cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptools".

The whole log is as it follows:

Command: "D:\home\site\deployments\tools\deploy.cmd" Handling python deployment. Detected requirements.txt. You can skip Python specific steps with a .skipPythonDeployment file. Detecting Python runtime from site configuration Detected python-3.4 Found compatible virtual environment. Pip install requirements. Downloading/unpacking setuptools>=18.5 (from -r requirements.txt (line 1)) Requirement already satisfied (use --upgrade to upgrade): Flask==0.12.1 in d:\home\site\wwwroot\env\lib\site-packages (from -r requirements.txt (line 2)) Downloading/unpacking azure-storage-file==1.1.0 (from -r requirements.txt (line 3)) Downloading azure_storage_file-1.1.0-py2.py3-none-any.whl Downloading/unpacking azure-storage-common>=1.1.0,<1.2.0 (from azure-storage-file==1.1.0->-r requirements.txt (line 3)) Downloading/unpacking azure-storage-nspkg>=2.0.0 (from azure-storage-file==1.1.0->-r requirements.txt (line 3)) Downloading azure_storage_nspkg-3.0.0-py2.py3-none-any.whl Downloading/unpacking azure-common>=1.1.5 (from azure-storage-file==1.1.0->-r requirements.txt (line 3)) Downloading azure_common-1.1.10-py2.py3-none-any.whl Downloading/unpacking cryptography (from azure-storage-common>=1.1.0,<1.2.0->azure-storage-file==1.1.0->-r requirements.txt (line 3)) Running setup.py (path:D:\home\site\wwwroot\env\build\cryptography\setup.py) egg_info for package cryptography Traceback (most recent call last): File "", line 17, in File "D:\home\site\wwwroot\env\build\cryptography\setup.py", line 28, in "cryptography requires setuptools 18.5 or newer, please upgrade to a " RuntimeError: cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptools Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 17, in File "D:\home\site\wwwroot\env\build\cryptography\setup.py", line 28, in "cryptography requires setuptools 18.5 or newer, please upgrade to a " RuntimeError: cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptools ---------------------------------------- Cleaning up... Command python setup.py egg_info failed with error code 1 in D:\home\site\wwwroot\env\build\cryptography Storing debug log for failure in D:\home\pip\pip.log An error has occurred during web site deployment. \r\nD:\Program Files (x86)\SiteExtensions\Kudu\73.10426.3381\bin\Scripts\starter.cmd

"D:\home\site\deployments\tools\deploy.cmd"

Thanks in advance!

2

2 Answers

0
votes

You need to upgrade the python module setuptools installed on your target.

If you used python3 (it looks to be case from the log), run this command: pip3 install --upgrade setuptools

If you are still using python2 then this command pip install --upgrade setuptools.

If you do not have permission access then use the flag --user: pip3 install --user --upgrade setuptools

0
votes

Adding to OlivierM, installing Python packages in Azure App Services is little tricky using pip. It’s recommended to use wheels for installing Python dependencies.

Some packages may not install using pip when run on Azure. It may simply be that the package is not available on the Python Package Index. It could be that a compiler is required (a compiler is not available on the machine running the web app in Azure App Service).

Checkout the documentation on Troubleshooting - Package Installation: https://docs.microsoft.com/en-us/azure/app-service/web-sites-python-configure#troubleshooting---package-installation