I am currently building a project that uses Django Web Framework (hosted on AWSEB) but also needs to execute some R scripts. I have tried using subprocess.call(["Rscript", "R_django_test.R"]) but I get the following error "No such file or directory: 'Rscript': 'Rscript'". The code above works locally, but not on the project hosted on AWS. Any help would be greatly appreciated.
It would be easier to use Docker deployment if you don't yet. AWSEB uses Amazon Linux 2 a CentOS-based Linux distributive, so follow the guide How to install R on CentOS and place the commands into the Dockerfile, then RScript command will be available in the environment.
Related
I deployed my Python Django project to Azure Web Service Linux environment, and found an error most likely caused by the version of Azure's own Python version (see this post Azure Text to Speech Error: 0x38 (SPXERR_AUDIO_SYS_LIBRARY_NOT_FOUND) when deploying to Azure App Services Linux environment ). However, I cannot seem to find a way to upload my own Python package (3.10) to Azure Web Service Kudu site. Is there a way to do it?
Thanks.
Currently, This is not possible, the latest python runtime available in the Linux web app is 3.9
and in the other question, The default Linux Kudu page has a minimum number of features available when compared to windows and so you cannot directly drag and drop your zip file. If you need to install more components or language runtimes, you just need to use Kudu SSH terminal using apt-get install <packages>.
Also, try checking Configure a Linux Python app for Azure App Service
Python 3.10 is now supported on App Service, so for this particular problem, you can update the configuration to Python 3.10.
Hello I'm having this problem when trying to deploy a django application to aws, the app runs perfectly locally but when trying to deploy to aws this error shows up.
like this
I tried to install that manually, but it doesn't work that way.
If the docker version for your deployment runner is 20.x - it's probably this https://github.com/docker/compose/issues/8105
Try pinning the deploy docker version to 19.03.13ce-1
I'm hosting a website on AWS. Its a web interface with a SQL database. The website will be used to:
1. View results of query from Database
2. Insert data into database
3. View the data and update it where needed.
The codes and connections works file when I run the application on localhost (Apache on my C drive). But we want to host it on AWS so that people around me can use it.
So, In AWS I uploaded the code on EC2 and installed apache on it, all the html links are working but the python file is simply displaying the code.
I'm guessing it has something to do with the shebang. Currently my code has the following shebang:
#!C:\Python27\python.exe
Can someone guide me if its the shebang or if there is something else i need to do.
I have installed boto, but not sure what to do next. The AWS website and most of the forums talk about using Elastic Beanstalk. I want to host a fully functioning Python webApp on AWS without using Elastic Beanstalk.
When apache displays code, that is a clear sign that Apache is not configured properly to execute python. You should look to see if mod_python is installed and configured correctly.
Also, #! is generally used with Linux not windows. If apache/mod_python is installed and configured correctly I can't imagine what code you'd have that would need #! since the .py extension would be enough.
IF your EC2 instance is indeed running Linux, and your code does indeed need #! try:
#!/bin/python
OR
#!/usr/local/bin/python
(Depends on where the python binary is, and those are the most common locations.)
If your EC2 instance is running Windows then "Unless you are using cygwin, windows has no shebang support"
Hi have you logged into your EC2 instance through the endpoint and then run your script, from the command line. I have some experience with EC2 running apache2 only my application was written in Java, having previously used python scripts I was able to run them by logging into my EC2 instance, you can do this from AWS management console. hope this helps you somewhat.
I've grown tired of trying to get elastic beanstalk to run python 3.5. Instead, I want to create a custom ami which establishes a separate virtualenv for the application (with python 3.5) and knows enough to launch the application using that virtualenv.
The problem is that once I ssh into the ec2 instance in order to create my custom ami, I am left wondering where the scripts are which govern the elastic beanstalk deployment behavior.
For example, when deploying via travis to elastic beanstalk, EB knows enough to look in a specific folder for the file application.py and to execute the file using a specific virtualenv (or maybe even the shudder root python installation of the machine). It even knows to execute a pip install -r requirements. Can anyone point me to where the script(s) are which govern this behavior?
UPDATE
Please see Elastic beanstalk require python 3.5 for those referencing the .ebextensions option. So far, it has not proved able to handle this problem due to the interdependency between the EB image operating system and the python environment used to run the application.
All of the EB files can be found in /opt/elasticbeanstalk - /opt/elasticbeanstalk/hooks is probably most relevant for what you're looking for.
You can use the ebextensions to run scripts you want when starting your ami.
I Deployed a project on the scraping-hub but my spider isn't working because scraping-hub uses an old version of twisted library. The project is working fine on my local machine, Is there anyway that i could make an egg of the twisted updated version and deploy it on scraping-hub.
Would this help: http://doc.scrapinghub.com/shub.html#deploying-dependencies
?
It shows how to deploy specific dependencies for you project to scrapinghub cloud service.