I have created a python application containing rest apis which call machine learning code on PyCharm IDE. I want to deploy rest apis on IIS.
I copy and past complete PyCharm project in virtual directory. The issue I am facing is dependencies like tensorflow and keras are not being found due to which API is giving "Internal server error", however I am able to call rest services.
please guide.
As FishingCode suggested please share code snippet to understand the exact issue.
Please include and install requirements.txt file in virtual environment.
Also, you may try installing using docker tutorial
Related
I am working on a Django project needing Newspaper3K to retrieve some information over the internet. Trying to deploy my Django web app onto the free OpenShift Online 3.0 Starter, the build fails when it comes to installing the Newspaper3K and hence its dependency NLTK.
Please advise the correct steps to achieve this "Django with NLTK deploying to OpenShift 3" installation. Thanks!
It turned out to be blocked by the lxml package. The default version of pip fails to compile it. Thanks to the answer here
https://stackoverflow.com/a/46125643/8583561
I set the environment variable
UPGRADE_PIP_TO_LATEST=1
This should be added to the .s2i/environment file.
This enables the PIP to be updated to the latest and the build is completed without an issue.
I'm trying to deploy a Flask web app with mysql connectivity. It's my first time using Azure, and coming off Linux it all seems pretty confusing.
My understanding is that one includes within the requirements.txt to include the packages required. When I build the default Flask app from Azure the file looks like this:
Flask<1
At this stage the site loads fine.
If I then include an additional line
https://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.1.14.tar.gz
As per this answer https://stackoverflow.com/a/34489738/2697874
Then in my views.py file (which seems to be broadly synonymous to my old app.py file) I include...import mysql.connector
I then restart and reload my site...which then returns the error The page cannot be displayed because an internal server error has occurred.
Error logging spits out a load of html (seems pretty weird way to deliver error logs - so I must be missing something here). When I save to html and load it up I get this...
How can I include the mysql.connector library within my Flask web app?
Per my experience, the resoure https://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.1.14.tar.gz is for Linux, not for Azure WebApps based on Windows, and the link seems to be not available now.
I used the command pip search mysql-connector to list the related package. Then, I tried to use mysql-connector instead of mysql-connector-python via pip install, and tried to import mysql.connector in local Python interpreter that works fine.
So please use mysql-connector==2.1.4 instead of mysql-connector-python== in the requirements.txt file of your project using IDE, then re-deploy the project on Azure and try again. The package will be installed automatically as the offical doc said as below.
Package Management
Packages listed in requirements.txt will be installed automatically in the virtual environment using pip. This happens on every deployment, but pip will skip installation if a package is already installed.
Any update, please feel free to let me know.
I am using Google App Engine and PyCharm 4.0.4 and GCloud managedvm.
I am attempting to access more information about the building of my dockerfile than is given by console output when running locally using dev_appserver.py .
medusavm is a python linux console app that can convert python code to dart code, among other functionalities.
In my dockerfile, medusavm installs without a hitch. I have managed to setup debugging using PyCharm, so I have access to breakpoint debugging functionality, if that is required.
I have a problem with running medusavm, even though it installs without a hitch. At the moment I can only access information from the console. I am running a local debug using the gcloud version of dev_appserver.py, accessed from:
C:/Program Files/Google/Cloud SDK/google-cloud-sdk/platform/google_appengine/dev_appserver.py
I have managed to successfully run the gcloud gae tutorial app using this exact setup, so I think it is a problem with the modifications I have made in my dockerfile to do with installing medusavm.
A link to the text document of my docker file is here and the console output from building from the dockerfile ( the part that I would like more info on for debugging purposes, if you know how to) is here.
If, miraculously, you know the problem that I am facing, (which currently I do not, other than that it originates from not installing medusavm properly), that would be incredibly helpful!
Also, if you happen to know how to debug dockerfiles while using gcloud and gae, I would greatly appreciate that too.
Thank you for taking your time to read this.
I am successfully able to get BQ data from one project to another from the advice in this answer. However this only works when deployed on my development/staging instance and not my local development server on Google App Engine.
My findings are that it works in production because you include:
libraries:
- name: pycrypto
version: "latest"
in app.yaml. However these libraries are not accessible from the dev server. I have tried installing everything locally (Pycrypto, oauth2client, openSSL) after digging through some docs and tracing the error but still cannot get it to work. I have tried installing through pip and manually doing the build/install from the raw files to no avail. Any advice on getting these queries to work on the local django server? Working on Ubuntu if that matters, perhaps it's looking in the wrong spot for the libraries?
If its just the libs that are mising follow this answer https://stackoverflow.com/a/11405769/3877822 to insatll pycrypto to the root of your project
As #Udi suggests in the comment below, the following command also
installs pycrypto and can be used in virtualenv as well:
easy_install
http://www.voidspace.org.uk/downloads/pycrypto26/pycrypto-2.6.win32-py2.7.exe
Notice to choose the relevant link for your setup from this list
I'm learning flask web app.
I find a flask extension called Flask-SuperAdmin from github https://github.com/SyrusAkbary/Flask-SuperAdmin
I've already fork it, but I don't know how to run Flask-SuperAdmin example at local host.
Thanks!
You don't need to fork it to run it; you fork it if you want to make changes to it or to fix a bug in it.
To install it, use the standard Python installation tools:
pip install Flask-SuperAdmin
Then, read the quickstart section of the documentation to help you get started.