diff --git a/twarc/command2.py b/twarc/command2.py
index <HASH>..<HASH> 100644
--- a/twarc/command2.py
+++ b/twarc/command2.py
@@ -112,6 +112,11 @@ def configure(ctx):
     config_file = config_provider.file_path
     logging.info('creating config file: %s', config_file)
 
+    config_dir = pathlib.Path(config_file).parent
+    if not config_dir.is_dir():
+        logging.info('creating config directory: %s', config_dir)
+        config_dir.mkdir(parents=True)
+ 
     keys = handshake()
     if keys is None:
         raise click.ClickException("Unable to authenticate")
@@ -686,12 +691,3 @@ def _error_str(errors):
 def _write(results, outfile, pretty=False):
     indent = 2 if pretty else None
     click.echo(json.dumps(results, indent=indent), file=outfile)
-
-"""
-def _get_config_file():
-    config_dir = pathlib.Path(click.get_app_dir('twarc'))
-    if not config_dir.is_dir():
-        config_dir.mkdir(parents=True)
-    config_file = config_dir / 'config'
-    return config_file
-"""
diff --git a/twarc/version.py b/twarc/version.py
index <HASH>..<HASH> 100644
--- a/twarc/version.py
+++ b/twarc/version.py
@@ -1 +1 @@
-version = '2.1.6'
+version = '2.1.7'
Create config directory when not present

The code to create the directory used by the configuration file was
accidentally removed in the last release, but is now reinstated.

fixes #<I>