import stdlib modules from file?

8 views
Skip to first unread message

Ed

unread,
Mar 11, 2026, 6:47:52 AM (5 days ago) Mar 11
to bry...@googlegroups.com

asked this on github, then noticed no posts in 6 months.


is there something special about importing stdlib modules from a file? brython won't retrieve the file by name like other modules.

using brython.min.js 3.13. have utils.py and sys.py in same dir /scripts.

import utils works fine, no problem. fails when I do import sys.
says it can't find module sys.


Browser console:

brython.min.js:1 Traceback (most recent call last):
  File "scripts/userpage.py#__main__646957374768381", line 8, in <module>
    import utils
  File "https://myserver.to/scripts/utils.py", line 9, in <module>
    import sys
ModuleNotFoundError: No module named 'sys'  <--- it's in https://myserver.to/scripts/sys.py
Reply all
Reply to author
Forward
0 new messages