While installing apache-superset I have faced an error while executing "superset db upgrade"
Error: Could not locate a Flask application. Use the 'flask --app' option, 'FLASK_APP' environment variable, or a 'wsgi.py' or 'app.py' file in the current directory.
(venv2) C:\Users\ACER\Virtual_environment2>superset db upgrade
Usage: superset [OPTIONS] COMMAND [ARGS]...
Try 'superset --help' for help.
Error: Could not locate a Flask application. Use the 'flask --app' option, 'FLASK_APP' environment variable, or a 'wsgi.py' or 'app.py' file in the current directory.
Related
When running this command locally on mac, this works fine. However when running the same command on amazon linux, i get this issue:
command:
cookiecutter -f -v --no-input --config-file config.yaml https://bitbucket.org/project/cookiecutter-template.git --checkout master
config.yaml contents:
default_context:
module_name: "tf-test"
module_description: "This module provides resources for the tf-test service in AWS"
release_date: "2022-06-07"
terraform_version: "0.11.14"
owner_email: "project#work.co.uk"
precommit_version: "0.1.0"
Error code:
DEBUG cookiecutter.config: Loading custom config from config.yaml.
DEBUG cookiecutter.config: config_path is config.yaml
DEBUG cookiecutter.utils: Making sure path exists: /root/.cookiecutters/
DEBUG cookiecutter.vcs: repo_dir is /root/.cookiecutters/cookiecutter-template
DEBUG cookiecutter.main: context_file is /root/.cookiecutters/cookiecutter-template/cookiecutter.json
DEBUG cookiecutter.generate: Context generated is OrderedDict([(u'cookiecutter', OrderedDict([(u'name', u'component-example'), (u'description', u'env-component cookiecutter example'), (u'owner_name', u''), (u'terraform_version', u'0.11.14'), (u'owner_email', u'project#work.co.uk'), (u'precommit_version', u'0.1.0'), (u'jenkins_library', u'poc'), (u'jenkins_library_version', u'master')]))])
Unable to load extension: No module named html.entities
This fixed it for me
source ~/.bash_profile
export PATH="~/.local/bin:$PATH"
python3 -m pip install "cookiecutter==2.1.1"
I was originally doing this:
pip install --user cookiecutter
I have already deployed my Django project to EB on AWS and it is working fine.
I tried deploying it now with an Immutable Deployment Policy and I am getting this error:
Command failed on instance. Return code: 2 Output: python: can't open file '/opt/python/current/app/manage.py': [Errno pt/python/current/app/manage.py': [Errno 2] No such file or directory.
And that happens during the command: source /opt/python/current/env && python /opt/python/current/app/manage.py migrate
For some reason, I can't include that command on the first deployment.
Does anyone know how to use the immutable deployment method with Django?
The following:
source /opt/python/current/env && python /opt/python/current/app/manage.py migrate
is useful when you ssh into the EB instance and want to manually run your code with environmental variables.
When you deploy your EB, container_commands in your .ebextensions would be better in my view.
For example, you could have the following file .ebextensions/10_run_migrate.config
container_commands:
10_run_migrate:
command: 'python ./manage.py migrate'
Please note that this is an example only. Thus the file may require adjustment with Django specific commands or settings.
I'm trying to deploy a Node.js API with Elastic beanstalk.
I want to set the node command to start the app.
This is my nodecommand.config:
option_settings:
aws:elasticbeanstalk:container:nodejs:
NodeCommand: "npm start"
This is my file structure:
Whenever I try to run eb deploy, I get this error:
2020-05-13 19:03:44 INFO Environment update is starting.
2020-05-13 19:03:48 ERROR "option_settings" in one of the configuration files failed validation. More details to follow.
2020-05-13 19:03:48 ERROR Unknown or duplicate parameter: NodeCommand
2020-05-13 19:03:48 ERROR Failed to deploy application.
ERROR: ServiceError - Failed to deploy application.
I just encountered this very same issue. Upon investigation I found that "NodeCommand" is the legacy way to run your application with custom commands.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs.container.html
I removed the ".ebextensions" directory and added a file called "Procfile" to my source directory.
Inside Procfile, try putting the following:
web: npm start
Make sure you update your repository with these changes if necessary before trying to deploy.
Hope this helps!
I used Procfile to deploy app
in Procfile
web: npm run deploy
In package.json, added new command deploy
"scripts": {
"deploy": "npm run build && npm run start"
},
For those who came here through Google, I had a similar problem and was getting this response:
ERROR: ServiceError - Configuration validation exception: Unknown or duplicate parameter: NodeVersion
After trying a lot of things I learned this is now legacy. I deleted that file and added a ProcFile at the root of my application (file name is case sensitive, there doesn't seem to be a required extension), with this line:
web: npm start
That error disappeared (to be replaced by a different one about role permissions, but any progress is good progress, right?).
When I run this command:
FLASK_APP=web.py flask run
I get this error:
File "<ipython-input-2-26c34e6a35fe>", line 1
FLASK_APP=web.py flask run
^
SyntaxError: invalid syntax
What am I missing?
You seem to be running a terminal command inside ipython based on the error message.
The problem with this is that you haven't told ipython that you're trying to run a terminal command.
In Jupyter Notebook you can execute Terminal commands in the notebook cells by prepending an exclamation point/bang(!) to the beginning of the command.
source
So do this instead:
!FLASK_APP=web.py flask run
I'm setting up the virtual environment of Django for the first time. I've downloaded the Anaconda library of Python in my D drive. So initially I set up the path of Python and Conda(Scripts) manually in advance system settings. But now when I'm creating the environment using command
conda create --name mydjang0 django
the command prompt is showing an error like this-
C:\Users\AABHA GAUTAM> conda create --name mydjang0 django
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/pro/win-64/repodata.json.bz2>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.
SSLError(MaxRetryError('HTTPSConnectionPool(host='repo.anaconda.com', port=443): Max retries exceeded with url: /pkgs/pro/win-64/repodata.json.bz2 (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))'))
If you already have a .condarc file in your root folder. Then update the file by running this command.
conda config --set ssl_verify false
If you do not have a .condarc file, then create one and then run the above command. I have added both the commands below.
conda config --add channels conda-forge
conda config --set ssl_verify false
Instead of using command prompt use Anaconda Prompt as administator.
run the same command there.
I also faced same issue with command prompt.
Only delete file .condrac from c:\users\user