-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot run as module #1298
Comments
Which version of Python-Markdown are you using? It looks like you are using Python3.10, but is that Arch's default CPython or something else? It is really odd that it works from |
Python-Markdown version: $ pip list -v | grep Markdown
Markdown 3.4.1 /home/ervin/.local/lib/python3.10/site-packages pip Python version according to pacman:
Running in the python console: $ python
Python 3.10.8 (main, Oct 13 2022, 21:13:48) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import markdown
Traceback (most recent call last):
File "/usr/lib/python3.10/importlib/util.py", line 96, in find_spec
parent_path = parent.__path__
AttributeError: module 'html' has no attribute '__path__'. Did you mean: '__name__'?
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ervin/.local/lib/python3.10/site-packages/markdown/__init__.py", line 22, in <module>
from .core import Markdown, markdown, markdownFromFile
File "/home/ervin/.local/lib/python3.10/site-packages/markdown/core.py", line 27, in <module>
from .preprocessors import build_preprocessors
File "/home/ervin/.local/lib/python3.10/site-packages/markdown/preprocessors.py", line 29, in <module>
from .htmlparser import HTMLExtractor
File "/home/ervin/.local/lib/python3.10/site-packages/markdown/htmlparser.py", line 29, in <module>
spec = importlib.util.find_spec('html.parser')
File "/usr/lib/python3.10/importlib/util.py", line 98, in find_spec
raise ModuleNotFoundError(
ModuleNotFoundError: __path__ attribute not found on 'html' while trying to find 'html.parser'
>>> This is interesting. Following is my pythonrc:
Does this interfere with the module? I'll check by removing it temporarily. |
So the anomaly appears to be Regardless, the code which is causing the error is this: markdown/markdown/htmlparser.py Lines 27 to 32 in e97ffeb
Annoyingly, on some Python installations this seems to fail and I have no idea why as this is the way that |
Well, I do have |
This appears to be a duplicate of #1132 in that the same root issue is causing the problem. |
fails with:
Any ideas?
markdown_py
works fine.Running on Arch currently on linux-next.
The text was updated successfully, but these errors were encountered: