diff --git a/plotid/publish.py b/plotid/publish.py
index 53ede90c1c60cbd263a2864feebaa28da671cbaa..fab060c3f29f398333e114ee43cc68f86659ebda 100644
--- a/plotid/publish.py
+++ b/plotid/publish.py
@@ -259,13 +259,13 @@ class Analyzer(ast.NodeVisitor):
             "from": [],
         }
 
-    def visit_import(self, node: ast.Import) -> None:
+    def visit_Import(self, node: ast.Import) -> None:
         """Get modules that are imported with the 'import' statement."""
         for alias in node.names:
             self.stats["import"].append(alias.name)
         self.generic_visit(node)
 
-    def visit_import_from(self, node: ast.ImportFrom) -> None:
+    def visit_ImportFrom(self, node: ast.ImportFrom) -> None:
         """Get modules that are imported with the 'from X import Y' statement."""
         self.stats["from"].append(str(node.module))
         self.generic_visit(node)