在试验brython项目时,运行" scripts / make_dist"总是出错:
File "../scripts/make_dist.py", line 14, in <module>
import make_doc # lint:ok
File "/home/.../brython-3.1.1/scripts/make_doc.py", line 42, in <module>
html, scripts = markdown.mark(src)
AttributeError: 'module' object has no attribute 'mark'
问题是由the file github.com/brython-dev/brython/scripts/make_doc.py引起的。
在深入思考的同时,&#34; Lib/browser/markdown.py&#34;或&#34; Lib/markdown2.py&#34;在其&#34; www / src /&#34;确实包含一个函数&#34; mark()&#34;在他们每个人。虽然这些文件是为在浏览器内运行而定制的,但不能在host / unix环境中使用。
哪个&#34;降价&#34;版本包含这样一个&#34; mark()&#34;功能?那些brython markdown / markdown2文件来自哪里?你如何运行&#34; make_dist.py&#34;?
答案 0 :(得分:1)
It's hard to be sure, but you might have a module "markdown" in your Python distribution. In this case, import markdown
would import this module, not the one provided by Brython.
Just add print(markdown)
after the line import markdown
to check which module is imported.
I will change make_doc.py to make sure the correct module is imported.