Azure Flask-Restful Deploy Failure - python

I'm trying to deploy a Flak Restful API to azure.
I have set up continuous deployment with a Github repo.
The deployment is failing on one of the requirements.txt
returning the following error:
ValueError: ('Expected version spec in', 'azure-common ~=1.1.4', 'at', ' ~=1.1.4')
The application is running fine locally.
I'm new to the Azure platform and the config and deploy files are quite confusing I'm not sure if the problem is with these or the package in the virtual environment.

You need to update pip, as I guess the version is old enough to do not support the "~=" syntax in the setup.py of the packages you install.
For examples:
ValueError "Expected version spec" when installing local wheel via pip
How to fix error “Expected version spec in …” using pip install on Windows?

Related

Error while running azuremlsdk::install_azureml() in R

I'm trying to load an existing azure workspace in RStudio Azure Compute Instance like it's shown in this link: https://azure.github.io/azureml-sdk-for-r/. But, after installing azuremlsdk package when I'm running this code azuremlsdk::install_azureml(). I'm getting this error :
Attempting uninstall: certifi  Found existing installation: certifi2016.9.26ERROR: Cannot uninstall 'certifi'. It is a distutilsinstalled project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.Error: Error installing package(s): 'azureml-sdk==1.10.0', 'numpy', 'pandas'
By referring to this link : https://learn.microsoft.com/en-us/azure/machine-learning/how-to-troubleshoot-environments; I tried to fix this error by running conda remove certifi through terminal of that Compute Instance & Jupyter Notebook of that Compute Instance. But, no luck.
Does anyone have any experience in resolving this issue. Please help.
Azure ML has issues with Python versions and its dependency packages, make sure you are using Python package of 3.5 to 3.8 while installing these.
While installing azureml it will search for all the dependency packages and will install all of them, in this process there will be the version issues, like pandas, numpy.. with different pip versions.
From your stack trace looks like the error is happening when we install the packages like pandas numpy etc along with azureml-train-automl-client package so try to install them before hand by checking its versions which are dependent with you python versions packages.
Check the Azure ML documentation for installation of Azure ML Additional packages.
If you investigate them azureml-train-automl requires somes data science packages including pandas, numpy, and scikit-learn.
Kindly follow below commands for conda environment:
pip install azureml-train-automl
pip install --upgrade azureml-train-automl
pip install show azureml-train-automl
It seems that the Python SDK installation conflicts with itself when using Python 3.6 (the default). I was able to install the SDK for Python 3.7:
azuremlsdk::install_azureml(conda_python_version = '3.7')

PyTorch wheel not supported on this platform error while deploying application

I am trying to deploy my pytorch application on zeet and my requirments.txt file contains this-
https://download.pytorch.org/whl/cpu/torch-1.3.1%2Bcpu-cp36-cp36m-linux_x86_64.whl
pickle-mixin
flask
simpletransformers
selenium
gunicorn
cloudpickle
When I try to build my application, I get the following error :
ERROR: torch-1.3.1+cpu-cp36-cp36m-linux_x86_64.whl is not a supported wheel on this platform.
Build failed 😔
I tried using multiple different versions of the wheel, but none to be working, I even tried the windows build but that isnt working too and I tried all the solutions I could find online but none seem to be working.
EDIT : My build command is pip install -r requirements.txt and my python version is python 3.8
Any Help Would Be Appreciated!!
In your requirements, you have a wheel dedicated for python 3.6 but you are using python 3.8 - cp36-cp36m part of the name torch-1.3.1%2Bcpu-cp36-cp36m-linux_x86_64.whl, to be exact. You should provide only version of torch in your requirements.txt (recommended) and make sure that you are using the same version of Python when developing and deploying.
Name of the wheel is the convention that is described here. It encapsulates where the wheel can be used.

docker build error when trying to pip install dict package

I only started getting the error when I moved my docker installation onto ubuntu (things were working fine on windows docker installation).
When I run docker build I get the following error when it is trying to install python package dict:
#14 1.681 Downloading dict-2020.7.1.tar.gz (1.8 kB)
#14 2.134 ERROR: Requested dict from https://files.pythonhosted.org/packages/67/fb/6a2458c82f59b4aad53949776608d97a46483c403df1dc20c39b413efe10/dict-2020.7.1.tar.gz#sha256=b54864077239b94e33376650824185c5aa310d3bf5089da57769f68413b6a83f has different version in metadata: '0.0.0'
(*if I remove the dict package from the requirements.txt file the docker build works fine, but my application fails to run in docker as it can't find the dict package)
when I look at the version of the dict package on my machine it shows version 0.0.0 even though the latest version is 2020.7.1?
Any suggestions on how to fix the error?
You should add --use-feature=2020-resolver to the pip installation command. According this issue: github.com/pypa/pip/issues/8707

Azure DevOps Pip Install

I am getting the following error when trying to deploy my build release for a python/flask web app:-
I created a python command task with the following -
pip install --upgrade
However, error persists.
I'd suggest you try to disable\suppress this error\warning (because its pretty harmless):
[global]
disable-pip-version-check = True
On many linux the default location for the pip configuration file is $HOME/.config/pip/pip.conf. You can always look that up in the docs.

Heroku - Flask - Bcrypt error

I am attempting to deploy a flask app on Heroku and it always errors at the same place. GCC fails to install and compile the Bcrypt module so I removed it from my requirements.txt (it is not used in the app). When I view the requrements.txt file, there is no mention of Bcrypt but when I push to heroku, it still tries to install it. I have committed the most recent version of requirements.txt to Git. Any help would be greatly appreciated.
I was able to solve this by using this custom heroku build pack:
heroku config:add BUILDPACK_URL=git://github.com/mfenniak/heroku-buildpack-python-libffi.git
I was able to get around it kind of, by successfully installing the following: "Successfully installed z3c.bcrypt python-bcrypt py-bcrypt-w32". Installing one of these (likely the second one) is what probably included the main bcrypt library that I guess needed to be compiled? I not 100% sure... I noticed this post is from July, I was able to download those libraries all using PIP.
Add cffi or cryptography in requirements.txt .That solved the problem in my case.

Categories