diff --git a/py/lexerunix.c b/py/lexerunix.c
index aa1cbc486d6c381cbe96ca87eee41edcee107f6a..fb62d3d72f44fc66d21e5577f31dd55e9781d6e2 100644
--- a/py/lexerunix.c
+++ b/py/lexerunix.c
@@ -30,24 +30,4 @@ mp_lexer_t *mp_lexer_new_from_file(const char *filename) {
     return mp_lexer_new_from_str_len(qstr_from_str(filename), data, size, size);
 }
 
-/******************************************************************************/
-/* unix implementation of import                                              */
-
-// TODO properly!
-
-static const char *import_base_dir = NULL;
-
-void mp_import_set_directory(const char *dir) {
-    import_base_dir = dir;
-}
-
-mp_lexer_t *mp_import_open_file(qstr mod_name) {
-    vstr_t *vstr = vstr_new();
-    if (import_base_dir != NULL) {
-        vstr_printf(vstr, "%s/", import_base_dir);
-    }
-    vstr_printf(vstr, "%s.py", qstr_str(mod_name));
-    return mp_lexer_new_from_file(vstr_str(vstr)); // TODO does lexer need to copy the string? can we free it here?
-}
-
 #endif // MICROPY_ENABLE_LEXER_UNIX
diff --git a/stm/lexerfatfs.c b/stm/lexerfatfs.c
index 026173db25aeb5e3520a64cad07c1eb484436dd6..d1686cb2222d9e5110d2a8817143c03e4fbcc524 100644
--- a/stm/lexerfatfs.c
+++ b/stm/lexerfatfs.c
@@ -51,36 +51,3 @@ mp_lexer_t *mp_lexer_new_from_file(const char *filename) {
     fb->pos = 0;
     return mp_lexer_new(qstr_from_str(filename), fb, (mp_lexer_stream_next_char_t)file_buf_next_char, (mp_lexer_stream_close_t)file_buf_close);
 }
-
-/******************************************************************************/
-// implementation of import
-
-#include "ff.h"
-
-mp_lexer_t *mp_import_open_file(qstr mod_name) {
-    vstr_t *vstr = vstr_new();
-    FRESULT res;
-
-    // look for module in src/
-    vstr_printf(vstr, "0:/src/%s.py", qstr_str(mod_name));
-    res = f_stat(vstr_str(vstr), NULL);
-    if (res == FR_OK) {
-        // found file
-        return mp_lexer_new_from_file(vstr_str(vstr)); // TODO does lexer need to copy the string? can we free it here?
-    }
-
-    // look for module in /
-    vstr_reset(vstr);
-    vstr_printf(vstr, "0:/%s.py", qstr_str(mod_name));
-    res = f_stat(vstr_str(vstr), NULL);
-    if (res == FR_OK) {
-        // found file
-        return mp_lexer_new_from_file(vstr_str(vstr)); // TODO does lexer need to copy the string? can we free it here?
-    }
-
-    // could not find file
-    vstr_free(vstr);
-    printf("import %s: could not find file in src/ or /\n", qstr_str(mod_name));
-
-    return NULL;
-}
diff --git a/unix/main.c b/unix/main.c
index f73c98ed694ab6a471936039b4ca1424f2277f35..d66595cd6648e5d527242344a6d93d7f82e15356 100644
--- a/unix/main.c
+++ b/unix/main.c
@@ -147,18 +147,6 @@ static void do_repl(void) {
 }
 
 static void do_file(const char *file) {
-    // hack: set dir for import based on where this file is
-    {
-        const char * s = strrchr(file, '/');
-        if (s != NULL) {
-            int len = s - file;
-            char *dir = m_new(char, len + 1);
-            memcpy(dir, file, len);
-            dir[len] = '\0';
-            mp_import_set_directory(dir);
-        }
-    }
-
     mp_lexer_t *lex = mp_lexer_new_from_file(file);
     execute_from_lexer(lex, MP_PARSE_FILE_INPUT, false);
 }