Some Python modules are not signed, will raise ImportError on M1 macOS:

ImportError: dlopen(/tmp/test/.venv/lib/python3.9/site-packages/regex/, 2): no suitable image found.  Did find:
	/tmp/test/.venv/lib/python3.9/site-packages/regex/ code signature in (/tmp/test/.venv/lib/python3.9/site-packages/regex/ not valid for use in process using Library Validation: Trying to load an unsigned library

You can use xcrun codesign to sign the library so: xcrun codesign -s - <path>. Here is:

xcrun codesign --sign - /tmp/test/.venv/lib/python3.9/site-packages/regex/