title: No schema has been selected to create in ... error
body: <p>I am working on a Linux server that is hosted on Amazon's server and I have completely set up the server. The final thing I am trying to do is host one of my old projects that I created on the server which is in the Flask framework.</p>
  <p>I am trying to run the Python file that sets up my database that is required to run my project.</p>
  <p>I am using a virtual machine inside the server that will run my project and every time I run the command I get the following error:</p>
  <pre class="lang-none prettyprint-override"><code>(venv) grader@ip-10-20-6-95:/var/www/catalog/catalog$ python setup_database.py
  Traceback (most recent call last):
    File &quot;setup_database.py&quot;, line 63, in &lt;module&gt;
      Base.metadata.create_all(engine)
    File &quot;/var/www/catalog/venv/local/lib/python2.7/site-packages/sqlalchemy/schema.py&quot;, line 2848, in create_all
      tables=tables)
    File &quot;/var/www/catalog/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py&quot;, line 1479, in _run_visitor
      conn._run_visitor(visitorcallable, element, **kwargs)
    File &quot;/var/www/catalog/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py&quot;, line 1122, in _run_visitor
      **kwargs).traverse_single(element)
    File &quot;/var/www/catalog/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py&quot;, line 122, in traverse_single
      return meth(obj, **kw)
    File &quot;/var/www/catalog/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/ddl.py&quot;, line 70, in visit_metadata
      self.traverse_single(table, create_ok=True)
    File &quot;/var/www/catalog/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py&quot;, line 122, in traverse_single
      return meth(obj, **kw)
    File &quot;/var/www/catalog/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/ddl.py&quot;, line 89, in visit_table
      self.connection.execute(schema.CreateTable(table))
    File &quot;/var/www/catalog/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py&quot;, line 662, in execute
      params)
    File &quot;/var/www/catalog/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py&quot;, line 720, in _execute_ddl
      compiled
    File &quot;/var/www/catalog/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py&quot;, line 874, in _execute_context
      context)
    File &quot;/var/www/catalog/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py&quot;, line 1024, in _handle_dbapi_exception
      exc_info
    File &quot;/var/www/catalog/venv/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py&quot;, line 196, in raise_from_cause
      reraise(type(exception), exception, tb=exc_tb)
    File &quot;/var/www/catalog/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py&quot;, line 867, in _execute_context
      context)
    File &quot;/var/www/catalog/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py&quot;, line 324, in do_execute
      cursor.execute(statement, parameters)
  sqlalchemy.exc.ProgrammingError: (ProgrammingError) no schema has been selected to create in
   '\nCREATE TABLE users (\n\tid SERIAL NOT NULL, \n\tusername VARCHAR(100), \n\temail VARCHAR(225) NOT NULL, \n\tprofile_pic VARCHAR(225) NOT NULL, \n\tPRIMARY KEY (id)\n)\n\n' {}
  </code></pre>
  <p>I am not sure why I get this error.<br />
  The commands I ran to set up PostgreSQL (if that should matter):</p>
  <pre><code>$ sudo apt-get install libpq-dev python-dev
  $ sudo apt-get install postgresql postgresql-contrib
  $ sudo su - postgres
  $ psql
  # CREATE USER catalog WITH PASSWORD 'sillypassword';
  # ALTER USER catalog CREATEDB;
  # CREATE DATABASE catalog WITH OWNER catalog;
  # \c catalog
  # REVOKE ALL ON SCHEMA public FROM public;
  # GRANT ALL ON SCHEMA public TO catalog;
  # \q
  $ exit
  </code></pre>
  <p>How could I fix this problem?</p>