Apache Superset installation issues - apache-superset

I have Ubuntu on a Windows machine and keep running into a few consistent errors:
One relating to the Werkzeug module: ModuleNotFoundError: No module named 'werkzeug.wrappers.etag'
A second related to a Flask environmental variable: You did not provide the "FLASK_APP" environment variable,
How do I handle these? I'm not the only one hitting these issues e.g., https://issuemode.com/issues/apache/superset/105505036)

try export FLASK_APP=superset
this worked for me

Related

Bitnami Django Stack - not importing modules

I just tried deploying my Django application on my windows machine using Bitnami's Django stack. However, when I try to access my project via localhost/myapp/, I get an error stating that I can't load my modules/python libraries. I checked via pip and I have these modules installed. It seems this error applies to all my modules/python libraries. How do I solve this? Thanks!
When you install the Bitnami Django Stack, it will ask you for changing Association Setting for Python with the following message:
"This option lets you change the Windows properties to associate the Python files to the new Python that are going to be installed. If you have your own Python you may want to disable this feature."
If you decided to use your Python instead of the one that is installed with the Stack, you have must ensure that you have installed Python in your system and all the modules and libraries are loaded, otherwise you won't be able to use any of them.

Running a zabbix LLD pythonscript on a pfSense zabbix-proxy

I have a pfSense router running a zabbix proxy.
I created a python script to discover connected devices on the network. I want zabbix to monitor the devices. When i run the script (as user zabbix on the shell) i have valid output. When i have the zabbix proxy run it i get a error (with another script the error module was six):
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
I tried setting the $PYTHONHOME in a wrapper script like
export PYTHONPATH=/usr/local/lib
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
/scripts/MDU-dhcp-scrape.py $1
I can't get it to work anyone has a clue what i am doing wrong?
I could not figure out the root cause of this. (i would still like to know it). But a workaround is to use cx_freeze or pyinstaller to create a standalone python script. This will do the trick. Downside is u need a FreeBSD box to freeze the script.

Fatal Python error: PyEval_AcquireThread

I just put up a django application online and i'm getting this error in my error log
Fatal Python error: PyEval_AcquireThread: NULL new thread state
I have seen a few similar questions online, but they do not explain this error.
The problem can appear if apache mod_wsgi and mod_python are both enabled.
Try
sudo a2dismod python
sudo service apache2 restart
This tends to indicate that your mod_wsgi is compiled for a different Python version and/or a different Python installation than the Python virtual environment or Python installation it is trying to use at runtime.
In other words, you are mixing compiled shared library and extension modules from different Python installations. This can cause all sorts of problems.
Go through the checks in:
http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation
to understand how your mod_wsgi has been built and verify it is what you expect it to be.
In my case it was permissions for the directories where Django or Flask project are. They were created from root, so I changed them to www-data in my case.

import error using djangorestframework with django-nonrel

I'm working on a Django-nonrel project using Django-rest-framework and I've run into the following error after following the instructions in the Token Authorization section of their Authorization API Guide:
ImportError: No module named rest_framework.authtoken
Normally I would just assume that this is something to do with my PYTHONPATH but I don't think that's exactly what the problem is because I can import this framework from both IDLE and the project's shell run using manage.py, the latter both with and without a virtual environment. Within the virtual environment I have installed django and djangorestframework, which should be the only requiremnets for the project thus far.
I had thought that it might have been a Python versioning problem but given that I can import the package directly from the project's shell (running under the virtual env) I'm kind of at a loss since theoretically running manage.py from the same virtual environment should result in the same context for locating libraries.
I've spent a long time searching around trying to fix this issue but to no avail. Any suggestions? I'm happy to provide any additional information as needed!
A few things to check:
Are you sure you are using the directory one level above rest_framework in your PYTHONPATH?
Did you restart your shell after installation?
Take a look at VirtualEnv PYTHONPATH setup. Did you try setting the PYTHONPATH for virtualenv explicitly?

How to set up Django development environment without installing?

I'm a student and the lab staff has set up permissions that won't students install software on the machines (or to our profiles).
I'm curious how I can develop Django application in a contained environment. I checked out the Django trunk to my Ubuntu home directory and added the bin path to my .bashrc. But when I try to use django-admin.py, an error occurs:
ImportError: No module named django.core
I'm quite confident this is simply a path issue. My real question is whether there's a proper to do self-contained development or if I need to manually add paths, and which if so.
In advance, thanks.
You can manually set the path:
import sys
sys.path.append('/home/kevin/dir_with_module')
You may also want to look into setting up a virtual environment. This article has good information: http://www.clemesha.org/blog/modern-python-hacker-tools-virtualenv-fabric-pip/