Issues following the tutorial of frappe

I’m following the tutorial of frappe framework to create my own application. But in this step (Not Found) when I run this command bench new-site library it only creates a folder called library with one file: site_config.json, the other folders are not created.

Also, continuing with the tutorial when I execute the command bench use library and bench install-app library_management I received the following error:

Usage: bench [OPTIONS] COMMAND [ARGS]...

Error: No such command "use".
Usage: bench [OPTIONS] COMMAND [ARGS]...

Error: No such command "install-app".

Executing bench --help


  Bench manager for Frappe

  --help  Show this message and exit.

  backup                 backup site
  backup-all-sites       backup all sites
  config                 change bench configuration
  download-translations  Download latest translations
  get-app                clone an app from the internet and set it up...
  init                   Create a new bench
  migrate-3to4           Migrate from ERPNext v3.x
  new-app                start a new app
  new-site               Create a new site in the bench
  prime-wheel-cache      Update wheel cache
  release                Release app (internal to the Frappe team)
  restart                Restart supervisor processes
  set-default-site       Set default site for bench
  set-mariadb-host       Set MariaDB host for bench
  set-nginx-port         Set nginx port for site
  set-ssl-certificate    Set ssl certificate path for site
  set-ssl-key            Set ssl certificate private key path for site
  set-url-root           Set url root for site
  setup                  Setup bench
  start                  Start Frappe development processes
  switch-to-develop      Switch frappe and erpnext to develop branch
  switch-to-master       Switch frappe and erpnext to master branch
  switch-to-v4           Switch frappe and erpnext to v4 branch
  update                 Update bench

You might be on version 4.

How do I update to the last version?

I’m having this issue now, when I use the command bench new-site library:

Traceback (most recent call last):
  File "/opt/lsa/python/lib/python2.7/", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/opt/lsa/python/lib/python2.7/", line 72, in _run_code
    exec code in run_globals
  File "/home/lsa/frappe-bench/apps/frappe/frappe/utils/", line 77, in <module>
  File "/home/lsa/frappe-bench/apps/frappe/frappe/utils/", line 14, in main
  File "/home/lsa/frappe-bench/env/lib/python2.7/site-packages/click/", line 664, in __call__
    return self.main(*args, **kwargs)
  File "/home/lsa/frappe-bench/env/lib/python2.7/site-packages/click/", line 644, in main
    rv = self.invoke(ctx)
  File "/home/lsa/frappe-bench/env/lib/python2.7/site-packages/click/", line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/lsa/frappe-bench/env/lib/python2.7/site-packages/click/", line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/lsa/frappe-bench/env/lib/python2.7/site-packages/click/", line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/lsa/frappe-bench/env/lib/python2.7/site-packages/click/", line 464, in invoke
    return callback(*args, **kwargs)
  File "/home/lsa/frappe-bench/apps/frappe/frappe/", line 76, in new_site
    _new_site(db_name, site, mariadb_root_username=mariadb_root_username, mariadb_root_password=mariadb_root_password, admin_password=admin_password, verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)
  File "/home/lsa/frappe-bench/apps/frappe/frappe/", line 96, in _new_site
    _install_app("frappe", verbose=verbose, set_as_patched=not source_sql)
  File "/home/lsa/frappe-bench/apps/frappe/frappe/", line 117, in install_app
  File "/home/lsa/frappe-bench/apps/frappe/frappe/utils/", line 10, in before_install
    frappe.reload_doc("core", "doctype", "docfield")
  File "/home/lsa/frappe-bench/apps/frappe/frappe/", line 555, in reload_doc
    return frappe.modules.reload_doc(module, dt, dn, force=force)
  File "/home/lsa/frappe-bench/apps/frappe/frappe/modules/", line 37, in reload_doc
    return import_files(module, dt, dn, force=force)
  File "/home/lsa/frappe-bench/apps/frappe/frappe/modules/", line 17, in import_files
    return import_file(module, dt, dn, force=force)
  File "/home/lsa/frappe-bench/apps/frappe/frappe/modules/", line 22, in import_file
    ret = import_file_by_path(path, force)
  File "/home/lsa/frappe-bench/apps/frappe/frappe/modules/", line 54, in import_file_by_path
    import_doc(doc, force=force, data_import=data_import)
  File "/home/lsa/frappe-bench/apps/frappe/frappe/modules/", line 120, in import_doc
  File "/home/lsa/frappe-bench/apps/frappe/frappe/model/", line 196, in insert
  File "/home/lsa/frappe-bench/apps/frappe/frappe/model/", line 561, in run_post_save_methods
  File "/home/lsa/frappe-bench/apps/frappe/frappe/model/", line 509, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
  File "/home/lsa/frappe-bench/apps/frappe/frappe/model/", line 625, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/lsa/frappe-bench/apps/frappe/frappe/model/", line 608, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/lsa/frappe-bench/apps/frappe/frappe/model/", line 503, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/lsa/frappe-bench/apps/frappe/frappe/core/doctype/doctype/", line 102, in on_update
  File "/home/lsa/frappe-bench/apps/frappe/frappe/model/", line 62, in updatedb
  File "/home/lsa/frappe-bench/apps/frappe/frappe/model/", line 86, in sync
  File "/home/lsa/frappe-bench/apps/frappe/frappe/model/", line 117, in create
    COLLATE=utf8mb4_unicode_ci""" % (, add_text))
  File "/home/lsa/frappe-bench/apps/frappe/frappe/", line 148, in sql
  File "/home/lsa/frappe-bench/env/lib/python2.7/site-packages/MySQLdb/", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/home/lsa/frappe-bench/env/lib/python2.7/site-packages/MySQLdb/", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1050, "Table 'tabdocfield' already exists")

Maybe you have a database with that name already (?) Try --force