How to make changes in Airbnb Superset? - apache-superset

I deployed Superset on Ubuntu 14.04 from the source code and it works fine. Now I want to play with the superset code to make required changes. Like adding the Png downloadable option for charts.I made changes but it didn't reflect Superset build. How to make changes in Superset code that should reflect Superset on browser?
code Build Process:
git clone https://github.com/airbnb/superset
cd ${SUPERSET_HOME}/superset/assets
npm install : Will install the npm dependencies
pip install virtualenv : Will install virtualenv
virtualenv venv : Set virtualenv
. ./venv/bin/activate : activate virtualenv
pip install --upgrade setuptools pip : Will upgrade
npm run prod : Set NODE_ENV variable and run dependencies
cd ${SUPERSET_HOME}
python setup.py install
//Create an admin user :
fabmanager create-admin --app superset
//Initialize the database :
superset db upgrade
//Load some data to play with :
superset load_examples
//Create default roles and permissions :
superset init
//To start the server : superset runserver -p 9002

You can read all the details here: https://github.com/airbnb/superset/blob/master/CONTRIBUTING.md#setting-up-a-python-development-environment
The main idea is to install for development using:
python setup.py develop
And run dev server:
superset runserver -d

Related

Installing Apache Superset on Windows Server 2019, and connecting Superset with MSSQL

How Apache Superset can be installed on Windows Server 2019? What are the steps and commands to use for installing this?
First, you need to enable Linux on Windows Server 2019. Follow the steps mentioned here:
https://learn.microsoft.com/en-us/windows/wsl/install-manual
Besides this, you also might need to have Microsoft Build Tools for Visual Studio installed on your windows computer. You may install it following the steps here:
https://www.scivision.co/python-windows-visual-c++-14-required/
Once you have both these, run the following commands in the Linux terminal mentioned here to installing Apache Superset:
source: https://superset.apache.org/docs/installation/installing-superset-from-scratch
sudo apt-get install build-essential libssl-dev libffi-dev python3-dev python3-pip libsasl2-dev libldap2-dev
python3 -m pip install virtualenv
python3 -m venv superset
. superset/bin/activate
python3 -m pip install apache-superset
superset db upgrade
#after running above command if you get dataclass module missing error: run the following command, and then give the above command again:
pip install dataclasses
export FLASK_APP=superset
superset fab create-admin
#provide credentials
superset load_examples
superset init
superset run -p 8088 --with-threads --reload --debugger
Now you should be able to access apache superset at:
http://127.0.0.1:8088/login/
If you want to connect apache superset with MSSQL database, then you need to follow the steps mentioned here to install ODBC driver first:
https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15

pip3 is installing django globally not inside my environment

I used virtualenvwrapper to create a new env but when I tried to install pip3 to install newer versions of django it was install globally although my environment was activated , which leads to global installation of django ..
How can I use it only inside my virtual env
did you activated virtual env first ? If you see env name in front of name in terminal - it is activated. If it is activated try python3 -m pip install --upgrade pip
then python3 -m pip install django
it is obliged to install last stable version of django (3rd for now) I'm doing this often
Use below commands to install django inside virtual environment.
1) upgrade pip3:
python3 -m pip install --upgrade pip
2) Install virtual env
pip3 install virtualenv
3) You can then create a virtualenv using the full path like this:
virtualenv -p /home/example_username/opt/python-3.6.2/bin/python3 venv
4) Activate virtual env
source venv/bin/activate
5) install Django
pip3 install Django
1.create a virtualenvironment with virtualenv or venv.
2.Activate the virtual environment by entering in the virtual environment folder and type this command if you are on windows cd scripts then type activate.bat or if you are using git bash just do . scripts/activate then you will see ("name of your virtual environment") which proves that your virtual environment is active.
3.Then you can pip install django in your virtual environment
some images below to guide you
enter image description here
enter image description here
you are welcomed!!!

superset server not running

I am following the below instructions to install superset. In this step "superset runserver -d" getting an error below. How do I fix this issue. Thanks
[DEPRECATED] As of Flask >=1.0.0, this command is no longer supported, please use flask run instead, as documented in our CONTRIBUTING.md
[example]
flask run -p 8080 --with-threads --reload --debugger
# Install superset
pip install superset
# Create an admin user (you will be prompted to set a username, first and last name before setting a password)
fabmanager create-admin --app superset
# Initialize the database
superset db upgrade
# Load some data to play with
superset load_examples
# Create default roles and permissions
superset init
# To start a development web server on port 8088, use -p to bind to another port
superset runserver -d
Yesterday commit https://github.com/apache/incubator-superset/pull/5966 fixed similiar issue with docker install. Try to clone repo from scratch and go trough the following steps:
git clone https://github.com/apache/incubator-superset/
cd incubator-superset/contrib/docker
# prefix with SUPERSET_LOAD_EXAMPLES=yes to load examples:
docker-compose run --rm superset ./docker-init.sh
# you can run this command everytime you need to start superset now:
docker-compose up
New installation doc: https://github.com/apache/incubator-superset/blob/master/docs/installation.rst
Try the below steps:
$ pip install flask==1.0.0
$ pip install sqlalchemy==1.2.18
$ pip uninstall pandas
$ pip install pandas==0.23.4

how to install pip remotely using ssh

Hi I hope someone can point me in the right direction.
I am trying to upload a django project which I have developed locally on my machine and now moved the project files to a server and am trying to install django on the server.
I have Python 2.7.5 installed and accessed the server remotely using ssh (putty) I can confirm Python is installed by running the command python --version
I don't have pip installed as when i run the command pip --version
I get following notification
-bash: pip: command not found
I am new to django and python so not sure what I should do to install both django and pip.
p.s In my requirements file and when working locally I have pip and django installed correctly and all working.
Ok, lets say you are already on your remote server. First thing to do is to install pip for your version of python. You can do this via:
sudo apt-get install python-pip
From now you have pip installed. Next thing to do is to install django globally in your system:
pip install django==1.11
Please note that django 1.11 is the last version that supports
python2
Next thing to do is to create django app:
django-admin startproject test_project
And the last thing is to install virtualenv
To install libraries for each of your django projects and keep them
separate
pip install virtualenv
Also note
If you have requirements.txt file with all libs, you can do something like this on your remote server:
pip install -r requirements.txt
That will automatically install all libraries at once
First you should understand which OS you're running:
uname -a
and:
lsb_release -a
When you find the OS version, you can easily follow this guide:
https://packaging.python.org/guides/installing-using-linux-tools/#installing-pip-setuptools-wheel-with-linux-package-managers

How to install image processing just for a virtualenv project with pip for django

But I'm looking to install freetype, libjpeg, PIL build to add image processing to my django projects I've followed this installation http://dakrauth.com/blog/entry/python-and-django-setup-mac-os-x-leopard/ which installs it site wide but I can get it inside my virtualenv project.
Do I just cd into the working directory of the virtualenv (project) and install it there and will it just be available for that project or do I use pip? I couldn't find the packages in the pip repository. Can someone enlighten me please.
curl -O http://pypi.python.org/packages/source/d/distribute/distribute-0.6.21.tar.gz
tar -xzvf distribute-0.6.21.tar.gz
cd distribute-0.6.21
python distribute_setup.py
easy_install pip
pip install virtualenv
virtualenv --distribute --no-site-packages [myproject]
cd [myproject]
source bin/activate (this activates the sandbox that virtualenv created)
pip install django mysql-python
Go to the working directory of the virtualenv and then run
$ source bin/activate
This will set that virtual environment as your active one. So now that it's active, you can install what you want, either manually (by following those steps on the site you linked to) or with pip and it will automatically install it into your active virtualenv.
If you then, say, run python manage.py runserver while the same virtualenv is active, django will have access to your newly installed package. Once you want to unset that virtual environment as your active one, simply do deactivate.
I ran into something similar; what I did was install it into the default directory (e.g. Python27/Lib/site-packages) then cut and paste all the new files put there into the created environment's site-packages. Hacky, but works.
After that you can follow EEVIAC's instructions to actually get your server running.