f46d0a
diff --git a/virtualenv.py b/virtualenv.py
f46d0a
index e5d0883..34d2160 100755
f46d0a
--- a/virtualenv.py
f46d0a
+++ b/virtualenv.py
f46d0a
@@ -4,6 +4,15 @@
f46d0a
 import os
f46d0a
 import sys
f46d0a
 
f46d0a
+# The way virtualenv < 20 creates virtual environments
f46d0a
+# is not compatible with Python 3.11+ "frozen standard library modules"
f46d0a
+# https://docs.python.org/3.11/whatsnew/3.11.html#frozen-imports-static-code-objects
f46d0a
+if sys.version_info >= (3, 11):
f46d0a
+    venv_cmd = 'python{0.major}.{0.minor} -m venv'.format(sys.version_info)
f46d0a
+    sys.exit('ERROR: Virtual environments created by virtualenv < 20 '
f46d0a
+             'are not compatible with Python 3.11.\n'
f46d0a
+             'ERROR: Use `{}` instead.'.format(venv_cmd))
f46d0a
+
f46d0a
 # If we are running in a new interpreter to create a virtualenv,
f46d0a
 # we do NOT want paths from our existing location interfering with anything,
f46d0a
 # So we remove this file's directory from sys.path - most likely to be