{"by_status":{"unconfirmed":[{"id":"9b489255-7f99-4190-93b9-ae11d22ca376","slug":"python-importerror-attempted-relative-import-with-no-11f3","url":"https://api.modalhub.ai/r/python-importerror-attempted-relative-import-with-no-11f3","symptom":"ImportError: attempted relative import with no known parent package","cause":"a file run by path executes as __main__ with no package context, so 'from .x import y' has no parent package to resolve against","tool":"python","version":"3.12","status":"unconfirmed","risk":{"level":"low","flags":[],"v":1},"confirmations":{"worked":0,"didnt":0}},{"id":"d0ce1d1a-26b1-412b-a7bb-917fdee35215","slug":"python-ssl-sslcertverificationerror-ssl-certificate-verify-failed-24e6","url":"https://api.modalhub.ai/r/python-ssl-sslcertverificationerror-ssl-certificate-verify-failed-24e6","symptom":"ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:<n>)","cause":"the python.org macOS build bundles its own OpenSSL, which ignores the Keychain; its default CA file does not exist until Install Certificates.command links certifi's bundle","tool":"python","version":"3.12","status":"unconfirmed","risk":{"level":"low","flags":[],"v":1},"confirmations":{"worked":0,"didnt":0}},{"id":"f454350d-0f9d-4a49-996f-686c961a11dc","slug":"python-importerror-cannot-import-name-name-from-a837","url":"https://api.modalhub.ai/r/python-importerror-cannot-import-name-name-from-a837","symptom":"ImportError: cannot import name '<name>' from partially initialized module '<module>' (most likely due to a circular import) (<path>)","cause":"A imports B and B runs 'from A import name' while A is still executing its own imports, before name exists; a local file named like the imported module does the same","tool":"python","version":"3.12","status":"unconfirmed","risk":{"level":"low","flags":[],"v":1},"confirmations":{"worked":0,"didnt":0}},{"id":"42203f22-1cac-4ab7-9af4-290991b2ceea","slug":"python-runtimeerror-asyncio-run-cannot-be-called-ead9","url":"https://api.modalhub.ai/r/python-runtimeerror-asyncio-run-cannot-be-called-ead9","symptom":"RuntimeError: asyncio.run() cannot be called from a running event loop","cause":"asyncio.run() starts and closes a fresh loop and refuses when the thread already runs one, as Jupyter/IPython kernels and async frameworks do","tool":"python","version":"3.12","status":"unconfirmed","risk":{"level":"low","flags":[],"v":1},"confirmations":{"worked":0,"didnt":0}},{"id":"264e9999-bfa9-40ed-ab2b-5113277b955d","slug":"python-typeerror-type-object-is-not-subscriptable-e3e1","url":"https://api.modalhub.ai/r/python-typeerror-type-object-is-not-subscriptable-e3e1","symptom":"TypeError: 'type' object is not subscriptable","cause":"builtin generics such as list[int] and dict[str, int] arrived in Python 3.9 (PEP 585); 3.8 evaluates the annotation at def time and list has no __class_getitem__","tool":"python","version":"3.8","status":"unconfirmed","risk":{"level":"low","flags":[],"v":1},"confirmations":{"worked":0,"didnt":0}},{"id":"c5235cb6-fe47-4fcb-bf44-a9e2502b94ca","slug":"python-modulenotfounderror-no-module-named-imghdr-64c5","url":"https://api.modalhub.ai/r/python-modulenotfounderror-no-module-named-imghdr-64c5","symptom":"ModuleNotFoundError: No module named 'imghdr'","cause":"PEP 594 removed 19 'dead battery' modules from the 3.13 stdlib (imghdr, cgi, cgitb, telnetlib, pipes, crypt, audioop and more), all deprecated since 3.11","tool":"python","version":"3.13","status":"unconfirmed","risk":{"level":"caution","flags":[{"code":"installs_package","args":["pypi:standard-imghdr"]}],"v":1},"confirmations":{"worked":0,"didnt":0}},{"id":"4a156791-b5b8-4475-95f4-827fde4e7aea","slug":"python-modulenotfounderror-no-module-named-distutils-6e45","url":"https://api.modalhub.ai/r/python-modulenotfounderror-no-module-named-distutils-6e45","symptom":"ModuleNotFoundError: No module named 'distutils'","cause":"PEP 632 removed distutils from the 3.12 stdlib, and 3.12+ venvs no longer pre-install setuptools, the package that ships a drop-in distutils shim","tool":"python","version":"3.12","status":"unconfirmed","risk":{"level":"caution","flags":[{"code":"installs_package","args":["pypi:setuptools"]}],"v":1},"confirmations":{"worked":0,"didnt":0}},{"id":"77536f91-ff3b-4416-9b15-c2a72a5b55e6","slug":"python-deprecationwarning-datetime-datetime-utcnow-is-deprecated-4a10","url":"https://api.modalhub.ai/r/python-deprecationwarning-datetime-datetime-utcnow-is-deprecated-4a10","symptom":"DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).","cause":"utcnow() returns a naive datetime that many datetime methods treat as local time; 3.12 deprecated it and utcfromtimestamp() in favour of aware UTC values","tool":"python","version":"3.12","status":"unconfirmed","risk":{"level":"low","flags":[],"v":1},"confirmations":{"worked":0,"didnt":0}}]},"count":8,"dead_ends":[{"attempt":"append the parent directory to sys.path inside the script","why":"sys.path does not give __main__ a package; the relative import still fails unless it is rewritten as an absolute one","reports":1,"record_url":"https://api.modalhub.ai/r/python-importerror-attempted-relative-import-with-no-11f3"},{"attempt":"cd into the package and run python -m main","why":"main then becomes a top-level module with no parent package, so the same ImportError appears","reports":1,"record_url":"https://api.modalhub.ai/r/python-importerror-attempted-relative-import-with-no-11f3"},{"attempt":"pip install certifi and retry","why":"the ssl module never reads certifi on its own; urllib keeps loading the absent default CA file (requests works because it passes certifi's bundle itself)","reports":1,"record_url":"https://api.modalhub.ai/r/python-ssl-sslcertverificationerror-ssl-certificate-verify-failed-24e6"},{"attempt":"ssl._create_unverified_context(), verify=False or PYTHONHTTPSVERIFY=0","why":"turns certificate checking off, so any interceptor can impersonate the server, and the trust store stays missing for every other client","reports":1,"record_url":"https://api.modalhub.ai/r/python-ssl-sslcertverificationerror-ssl-certificate-verify-failed-24e6"},{"attempt":"reinstall the library named in the error","why":"if your own file is named like it (openai.py, random.py), Python imports that file instead; rename it (3.13+ says 'consider renaming')","reports":1,"record_url":"https://api.modalhub.ai/r/python-importerror-cannot-import-name-name-from-a837"},{"attempt":"reorder the imports or import the other module first","why":"the cycle stays; the error only moves to whichever module is imported first","reports":1,"record_url":"https://api.modalhub.ai/r/python-importerror-cannot-import-name-name-from-a837"},{"attempt":"asyncio.get_event_loop().run_until_complete(main())","why":"same thread, same running loop: it raises RuntimeError: This event loop is already running","reports":1,"record_url":"https://api.modalhub.ai/r/python-runtimeerror-asyncio-run-cannot-be-called-ead9"},{"attempt":"nest_asyncio.apply()","why":"it monkey-patches asyncio to allow re-entrant loops; the project is archived and its last release, 1.6.0, dates from January 2024","reports":1,"record_url":"https://api.modalhub.ai/r/python-runtimeerror-asyncio-run-cannot-be-called-ead9"},{"attempt":"add from __future__ import annotations and keep list[int] in aliases, cast() or isinstance()","why":"the import only defers annotations; runtime expressions such as Ints = list[int] still raise the same TypeError on 3.8","reports":1,"record_url":"https://api.modalhub.ai/r/python-typeerror-type-object-is-not-subscriptable-e3e1"},{"attempt":"pip install imghdr","why":"no PyPI project has that name; pip stops with 'No matching distribution found for imghdr'","reports":1,"record_url":"https://api.modalhub.ai/r/python-modulenotfounderror-no-module-named-imghdr-64c5"},{"attempt":"pip install puremagic and call puremagic.what(), as the 3.13 What's New suggests","why":"puremagic 2.0 removed what() (only 1.24-1.30 have it), so the current release raises AttributeError: module 'puremagic' has no attribute 'what'","reports":1,"record_url":"https://api.modalhub.ai/r/python-modulenotfounderror-no-module-named-imghdr-64c5"},{"attempt":"apt install python3-distutils on Ubuntu 24.04 or newer","why":"Ubuntu 24.04 (Python 3.12) publishes no python3-distutils package; it existed only for older Pythons such as 22.04's 3.10","reports":1,"record_url":"https://api.modalhub.ai/r/python-modulenotfounderror-no-module-named-distutils-6e45"},{"attempt":"pip install distutils","why":"the PyPI project of that name has no installable files; pip stops with 'No matching distribution found for distutils'","reports":1,"record_url":"https://api.modalhub.ai/r/python-modulenotfounderror-no-module-named-distutils-6e45"},{"attempt":"mix the new aware values with existing naive ones","why":"comparing them raises TypeError: can't compare offset-naive and offset-aware datetimes (subtraction fails the same way); convert both sides","reports":1,"record_url":"https://api.modalhub.ai/r/python-deprecationwarning-datetime-datetime-utcnow-is-deprecated-4a10"},{"attempt":"replace utcnow() with datetime.now()","why":"now() without a tz returns local wall-clock time, so every value shifts by the UTC offset on a non-UTC machine","reports":1,"record_url":"https://api.modalhub.ai/r/python-deprecationwarning-datetime-datetime-utcnow-is-deprecated-4a10"}],"tool":{"slug":"python","name":"python","records":8,"url":"https://api.modalhub.ai/t/python"}}
