title: how to fix 'TypeError: 'module' object is not callable' in flask?
body: <p>I want to create a web service using Python. 
  The service contents are as follows. </p>
  
  <ol>
  <li>Receive music files from users</li>
  <li>Analyze the received file and create a new music file. (The function implementation has already been completed using the python library.)</li>
  <li>Output the newly created music file to the user.</li>
  </ol>
  
  <p>The main goal is to analyze the music file and create a new one, and input and output the music file for this purpose is a secondary function. So I have no knowledge of creating web services and need help to implement this feature. I went to the internet and implemented it to some extent, but I get an error that I don't know why.</p>
  
  <p>I Upload the code for <code>app.py</code> and <code>__init__.py</code>. I also uploaded the structure of the directory. It looks like something needs to be fixed to use the functions inside the controller. I've been searching the internet and YouTube for more than twelve hours, but I don't really know. I created a class named <code>NoteConvertor</code> and <code>MarcovMatrix</code> in the controller directory.</p>
  
  <p>It runs until I go to <code>http://127.0.0.1:5000/</code> and receive a file. Then I get the following error:</p>
  
  <pre><code>File "C:\Users\K\git\flask\gp\app.py", line 24, in wav_transform
  
  sr, data = scipy.io.wavfile('static/file1.wav')
  
  TypeError: 'module' object is not callable
  
  -gp
  |----controller
  |        MarcovMatrix.py
  |        MatrixBuilder.py
  |        NoteConvertor.py
  |----static
  |        style.css
  |----templates
  |        index.html
  |        upload.html
  |        wavplay.html
  |----__init__.py
  |----app.py
  </code></pre>
  
  <p><strong>app.py</strong></p>
  
  <pre><code>import flask
  from flask import Flask, request, render_template
  from werkzeug.utils import secure_filename
  import scipy
  import numpy as np
  from scipy import misc
  import pysynth as ps      
  from scipy.io import wavfile  
  
  app = Flask(__name__)
  
  
  @app.route('/')
  @app.route("/upload")
  def index():
      return render_template('index.html')
  
  @app.route('/uploader', methods=['GET', 'POST'])
  def wav_transform():
      if request.method == 'POST':
          f = request.files['file']
          f.save(f'static/file1.wav')
          sr, data = scipy.io.wavfile('static/file1.wav')
  
          empty_notes = controller.NoteConvertor(data)
          notes = empty_notes.convertor()
          song = sum(notes, [])
  
          matrix = controller.MarcovMatrix(song)
          start_note = ['e4', 4]
  
          random_song = []
          for i in range(0, 100):
                  start_note = matrix.next_note(start_note)
                  random_song.append(start_note)
  
          ps.make_wav(random_song, fn='static/random.wav')
  
          return render_template('wavplay.html')
  
  
  if __name__ == '__main__':
      app.run(debug = True)
  
  
  __init__.py
  from gp.controller import MarcovMatrix
  from gp.controller import MatrixBuilder
  from gp.controller import NoteConvertor
  </code></pre>
  
  <p>I would like to tell you how to use the functions written in python (inside the controller) inside the flask. </p>
  
  <p>I would be very grateful if you would like to know how to do what I want to implement. Please understand this question because learning the basics of the web is not my main goal.</p>