<jupyter_start><jupyter_text>Launch voila app  1. Set up 1.1 Setting up virtual environmentSimilar to Flask apps we want to set up a virtual environment From the command line:1. mkdir app    - app is the name of folder2. cd app    - Changes directory to newly created folder3. python -m venv env    - Creates virtual environment4. source env/bin/activate    - Activates virtual environment5. pip install flask    - Virtual environment will not have installed libraries so you have to install flask ```bashmkdir appcd apppython -m venv envsource env/bin/activatepip install voilapip install jupyter numpy matplotlib```  1.2 Create interactive plots and test locally  1.2.1 Create interactive notebook<jupyter_code>import ipywidgets as widgets
import numpy as np
from ipywidgets import interactive
import matplotlib.pyplot as plt
def plot_func(a, f):
    plt.figure(2)
    x = np.linspace(0, 2*np.pi, num=1000)
    y = a*np.sin(1/f*x)
    plt.plot(x,y)
    plt.ylim(-1.1, 1.1)
    plt.title('a sin(f)')
    plt.show()

interactive_plot = interactive(plot_func, a=(-1,0,0.1), f=(0.1, 1))
output = interactive_plot.children[-1]
output.layout.height = '300px'
interactive_plot<jupyter_output><empty_output><jupyter_text>1.2.2 Test on your machineIn the command line of the same directory```bashvoila app.ipynb```  1.3 Upload to heroku server1. First, create an Heroku account    - https://signup.heroku.com/    2. Install Heroku on your machine:     - https://devcenter.heroku.com/articles/getting-started-with-pythonset-up  1.3.1 Create files necessary for Heroku app- Do this in the main directory  1.3.1.1 requirements.txt- This can either be manually entered or from the commmand line with the following code:```bashpip freeze > requirements.txt```<jupyter_code>%%writefile requirements.txt
voila
voila-material
ipywidgets
numpy
matplotlib<jupyter_output>Writing requirements.txt<jupyter_text>1.3.1.2 runtime.txt<jupyter_code>%%writefile runtime.txt
python-3.7.5<jupyter_output>Writing runtime.txt<jupyter_text>1.3.1.3 Procfile- IMPORTANT: the name of your notebook goes at the end of the procfile after:    - "--enable_nbextensions=True"<jupyter_code>%%writefile Procfile

web: voila --port=$PORT --no-browser --template=material --enable_nbextensions=True How_to.ipynb<jupyter_output>Writing Procfile
{'fraction_non_alphanumeric': 0.09691438504997828, 'fraction_numerical': 0.026510212950890916, 'mean_word_length': 4.573849878934625, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '475891', 'license': 'MIT', 'n_tokens_mistral': 778, 'n_tokens_neox': 745, 'n_words': 233, 'path': 'Voila/Deploy_Heroku.ipynb', 'repo_name': 'corybaird/Web_development', 'size': '2301'}