diff --git a/Library/Homebrew/utils/pypi.rb b/Library/Homebrew/utils/pypi.rb
index 357a0785f8aca0669f531baaeb2f0b5dd07e50b1..1dfd612738b8f91f535bd1ab0627c6e1822026fd 100644
--- a/Library/Homebrew/utils/pypi.rb
+++ b/Library/Homebrew/utils/pypi.rb
@@ -106,7 +106,7 @@ module PyPI
     packages = JSON.parse(pipgrip_output).sort.to_h
 
     # Remove extra packages that may be included in pipgrip output
-    exclude_list = %W[#{pypi_name} argparse pip setuptools wheel wsgiref]
+    exclude_list = %W[#{pypi_name.downcase} argparse pip setuptools wheel wsgiref]
     packages.delete_if do |package|
       exclude_list.include? package
     end