Es gibt bei Azure Web Apps zurzeit einen Bug beim Verwenden des azure-storage Moduls mit Python 3.4. Wenn man mit der requirements.txt über Git versucht das Modul azure-storage einzubinden erhält man den Fehler Unable to find vcvarsall.bat.

Fehlerbeschreibung

Azure Web Apps verwendet Python in der Version 3.4 und pip in der Version 1.5.6. In dieser pip Version gibt es den Parameter –find-links nicht, der aber zum installieren verwendet wird.

Workaround

  1. Beim Azure Portal anmelden
  2. Die Web App auswählen
  3. In dem Menü auf der linken Seite auf Advanced Tools klicken
  4. Auf den Link: Go klicken
  5. Oben im Menü auf Tools –> Download deployment script und die Zip Datei deploymentscript.zip herunterladen
  6. Datei entpacken und den Inhalt in euer git repository kopieren.
  7. Die Datei deploy.cmd editieren
  8. Zeile[code]echo Pip install requirements. env\scripts\pip install -r requirements.txt[/code] abändern in:[code]echo Upgrade pip package. env\scripts\python -m pip install pip –upgrade IF !ERRORLEVEL! NEQ 0 goto error echo Pip install requirements. env\scripts\pip install -r requirements.txt[/code]
  9. Die beiden neuen Dateien zu git hinzufügen (git add .), commiten und erneut pushen.

Komplette Fehlermeldung

Counting objects: 3, don. Delta compression using up to 4 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 289 bytes | 289.00 KiB/s, done. Total 3 (delta 2), reused 0 (delta 0) remote: Updating branch \'master\'. remote: Updating submodules. remote: Preparing deployment for commit id \'39d58a751f\'. remote: Generating deployment script. remote: Running deployment command... remote: Handling python deployment. remote: KuduSync.NET from: \'D:\\home\\site\\repository\' to: \'D:\\home\\site\\wwwroot\' remote: Copying file: \'main.py\' remote: Detected requirements.txt. You can skip Python specific steps with a .skipPythonDeployment file. remote: Detecting Python runtime from site configuration remote: Detected python-3.4 remote: Found compatible virtual environment. remote: Pip install requirements. remote: 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 1)) remote: Downloading/unpacking azure-storage==0.34.3 (from -r requirements.txt (line 2)) remote: Downloading/unpacking python-dateutil (from azure-storage==0.34.3->-r requirements.txt (line 2)) remote: Downloading/unpacking azure-nspkg>=2.0.0 (from azure-storage==0.34.3->-r requirements.txt (line 2)) remote: Downloading azure_nspkg-2.0.0-py2.py3-none-any.whl remote: Downloading/unpacking azure-common>=1.1.5 (from azure-storage==0.34.3->-r requirements.txt (line 2)) remote: Downloading azure_common-1.1.8-py2.py3-none-any.whl remote: Downloading/unpacking cryptography (from azure-storage==0.34.3->-r requirements.txt (line 2)) remote: Running setup.py (path:D:\\home\\site\\wwwroot\\env\\build\\cryptography\\setup.py) egg_info for package cryptography remote: remote: no previously-included directories found matching \'docs\\_build\' remote: warning: no previously-included files matching \'*\' found under directory \'vectors\' remote: Downloading/unpacking requests (from azure-storage==0.34.3->-r requirements.txt (line 2)) remote: Downloading/unpacking six>=1.5 (from python-dateutil->azure-storage==0.34.3->-r requirements.txt (line 2)) remote: Downloading six-1.11.0-py2.py3-none-any.whl remote: Downloading/unpacking idna>=2.1 (from cryptography->azure-storage==0.34.3->-r requirements.txt (line 2)) remote: Downloading/unpacking asn1crypto>=0.21.0 (from cryptography->azure-storage==0.34.3->-r requirements.txt (line 2)) remote: Downloading/unpacking cffi>=1.7 (from cryptography->azure-storage==0.34.3->-r requirements.txt (line 2)) remote: Running setup.py (path:D:\\home\\site\\wwwroot\\env\\build\\cffi\\setup.py) egg_info for package cffi remote: Traceback (most recent call last): remote: File "", line 17, in remote: File "D:\\home\\site\\wwwroot\\env\\build\\cffi\\setup.py", line 116, in remote: if sys.platform == \'win32\' and uses_msvc(): remote: File "D:\\home\\site\\wwwroot\\env\\build\\cffi\\setup.py", line 94, in uses_msvc remote: return config.try_compile(\'#ifndef _MSC_VER\\n#error "not MSVC"\\n#endif\') remote: File "D:\\python34\\lib\\distutils\\command\\config.py", line 227, in try_compile remote: self._compile(body, headers, include_dirs, lang) remote: File "D:\\python34\\lib\\distutils\\command\\config.py", line 133, in _compile remote: self.compiler.compile([src], include_dirs=include_dirs) remote: File "D:\\python34\\lib\\distutils\\msvc9compiler.py", line 460, in compile remote: self.initialize() remote: File "D:\\python34\\lib\\distutils\\msvc9compiler.py", line 371, in initialize remote: vc_env = query_vcvarsall(VERSION, plat_spec) remote: File "D:\\python34\\lib\\distutils\\msvc9compiler.py", line 259, in query_vcvarsall remote: raise DistutilsPlatformError("Unable to find vcvarsall.bat") remote: distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat remote: Complete output from command python setup.py egg_info: remote: Traceback (most recent call last): remote: remote: File "", line 17, in remote: remote: File "D:\\home\\site\\wwwroot\\env\\build\\cffi\\setup.py", line 116, in remote: remote: if sys.platform == \'win32\' and uses_msvc(): remote: remote: File "D:\\home\\site\\wwwroot\\env\\build\\cffi\\setup.py", line 94, in uses_msvc remote: remote: return config.try_compile(\'#ifndef _MSC_VER\\n#error "not MSVC"\\n#endif\') remote: remote: File "D:\\python34\\lib\\distutils\\command\\config.py", line 227, in try_compile remote: remote: self._compile(body, headers, include_dirs, lang) remote: remote: File "D:\\python34\\lib\\distutils\\command\\config.py", line 133, in _compile remote: remote: self.compiler.compile([src], include_dirs=include_dirs) remote: remote: File "D:\\python34\\lib\\distutils\\msvc9compiler.py", line 460, in compile remote: remote: self.initialize() remote: remote: File "D:\\python34\\lib\\distutils\\msvc9compiler.py", line 371, in initialize remote: remote: vc_env = query_vcvarsall(VERSION, plat_spec) remote: remote: File "D:\\python34\\lib\\distutils\\msvc9compiler.py", line 259, in query_vcvarsall remote: remote: raise DistutilsPlatformError("Unable to find vcvarsall.bat") remote: remote: distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat remote: remote: ---------------------------------------- remote: Cleaning up... remote: Command python setup.py egg_info failed with error code 1 in D:\\home\\site\\wwwroot\\env\\build\\cffi remote: Storing debug log for failure in D:\\home\\pip\\pip.log remote: An error has occurred during web site deployment. remote: remote: Error - Changes committed to remote repository but deployment to website failed.


Konnte ich helfen? Ich freue mich über einen Drink! 💙