from commonmark.main import commonmark THROWS “ ModuleNotFoundError: No module named 'commonmark'”












0















Very good morning. I am trying to install a simple python app for contentful. I downloaded it from this GitHub repo. When I try to launch the application using "make run" command, it is giving me the following error:



E:contentfulpythonthe-example-app.py>make run
python app.py
Traceback (most recent call last):
File "app.py", line 10, in <module>
from lib.markdown import markdown
File "E:contentfulpythonthe-example-app.pylibmarkdown.py", line 1, in <module>
import CommonMark
File "C:UsersadminAppDataLocalProgramsPythonPython38libsite-packagesCommonMark__init__.py", line 4, in <module>
from commonmark.main import commonmark
ModuleNotFoundError: No module named 'commonmark'
make: *** [run] Error 1


I am not sure how to go about this error. I found a main.py within the CommonMark folder. The main.py code looks like below.



# 2014 - Bibek Kafle & Roland Shoemaker
# 2015-2017 - Nikolas Nyby
# Port of @jgm's commonmark.js implementation of the CommonMark spec.

# Basic usage:
#
# import commonmark
# parser = commonmark.Parser()
# renderer = commonmark.HtmlRenderer()
# print(renderer.render(parser.parse('Hello *world*')))

from __future__ import absolute_import, unicode_literals

from commonmark.blocks import Parser
from commonmark.dump import dumpAST, dumpJSON
from commonmark.render.html import HtmlRenderer
from commonmark.render.rst import ReStructuredTextRenderer


def commonmark(text, format="html"):
"""Render CommonMark into HTML, JSON or AST
Optional keyword arguments:
format: 'html' (default), 'json' or 'ast'

>>> commonmark("*hello!*")
'<p><em>hello</em></p>\n'
"""
parser = Parser()
ast = parser.parse(text)
if format not in ["html", "json", "ast", "rst"]:
raise ValueError("format must be 'html', 'json' or 'ast'")
if format == "html":
renderer = HtmlRenderer()
return renderer.render(ast)
if format == "json":
return dumpJSON(ast)
if format == "ast":
return dumpAST(ast)
if format == "rst":
renderer = ReStructuredTextRenderer()
return renderer.render(ast)


I don't know how to proceed, could you please help me to run the python application. I really appreciate your kind help.



Thank you
Venu










share|improve this question















migrated from superuser.com Feb 10 at 8:12


This question came from our site for computer enthusiasts and power users.














  • 1





    Maybe you either haven't installed commonmark properly or you have an old version? github.com/rtfd/CommonMark-py/issues/137. Either way reinstall or upgrade commonmark.

    – Atirag
    Feb 10 at 8:43


















0















Very good morning. I am trying to install a simple python app for contentful. I downloaded it from this GitHub repo. When I try to launch the application using "make run" command, it is giving me the following error:



E:contentfulpythonthe-example-app.py>make run
python app.py
Traceback (most recent call last):
File "app.py", line 10, in <module>
from lib.markdown import markdown
File "E:contentfulpythonthe-example-app.pylibmarkdown.py", line 1, in <module>
import CommonMark
File "C:UsersadminAppDataLocalProgramsPythonPython38libsite-packagesCommonMark__init__.py", line 4, in <module>
from commonmark.main import commonmark
ModuleNotFoundError: No module named 'commonmark'
make: *** [run] Error 1


I am not sure how to go about this error. I found a main.py within the CommonMark folder. The main.py code looks like below.



# 2014 - Bibek Kafle & Roland Shoemaker
# 2015-2017 - Nikolas Nyby
# Port of @jgm's commonmark.js implementation of the CommonMark spec.

# Basic usage:
#
# import commonmark
# parser = commonmark.Parser()
# renderer = commonmark.HtmlRenderer()
# print(renderer.render(parser.parse('Hello *world*')))

from __future__ import absolute_import, unicode_literals

from commonmark.blocks import Parser
from commonmark.dump import dumpAST, dumpJSON
from commonmark.render.html import HtmlRenderer
from commonmark.render.rst import ReStructuredTextRenderer


def commonmark(text, format="html"):
"""Render CommonMark into HTML, JSON or AST
Optional keyword arguments:
format: 'html' (default), 'json' or 'ast'

>>> commonmark("*hello!*")
'<p><em>hello</em></p>\n'
"""
parser = Parser()
ast = parser.parse(text)
if format not in ["html", "json", "ast", "rst"]:
raise ValueError("format must be 'html', 'json' or 'ast'")
if format == "html":
renderer = HtmlRenderer()
return renderer.render(ast)
if format == "json":
return dumpJSON(ast)
if format == "ast":
return dumpAST(ast)
if format == "rst":
renderer = ReStructuredTextRenderer()
return renderer.render(ast)


I don't know how to proceed, could you please help me to run the python application. I really appreciate your kind help.



Thank you
Venu










share|improve this question















migrated from superuser.com Feb 10 at 8:12


This question came from our site for computer enthusiasts and power users.














  • 1





    Maybe you either haven't installed commonmark properly or you have an old version? github.com/rtfd/CommonMark-py/issues/137. Either way reinstall or upgrade commonmark.

    – Atirag
    Feb 10 at 8:43
















0












0








0








Very good morning. I am trying to install a simple python app for contentful. I downloaded it from this GitHub repo. When I try to launch the application using "make run" command, it is giving me the following error:



E:contentfulpythonthe-example-app.py>make run
python app.py
Traceback (most recent call last):
File "app.py", line 10, in <module>
from lib.markdown import markdown
File "E:contentfulpythonthe-example-app.pylibmarkdown.py", line 1, in <module>
import CommonMark
File "C:UsersadminAppDataLocalProgramsPythonPython38libsite-packagesCommonMark__init__.py", line 4, in <module>
from commonmark.main import commonmark
ModuleNotFoundError: No module named 'commonmark'
make: *** [run] Error 1


I am not sure how to go about this error. I found a main.py within the CommonMark folder. The main.py code looks like below.



# 2014 - Bibek Kafle & Roland Shoemaker
# 2015-2017 - Nikolas Nyby
# Port of @jgm's commonmark.js implementation of the CommonMark spec.

# Basic usage:
#
# import commonmark
# parser = commonmark.Parser()
# renderer = commonmark.HtmlRenderer()
# print(renderer.render(parser.parse('Hello *world*')))

from __future__ import absolute_import, unicode_literals

from commonmark.blocks import Parser
from commonmark.dump import dumpAST, dumpJSON
from commonmark.render.html import HtmlRenderer
from commonmark.render.rst import ReStructuredTextRenderer


def commonmark(text, format="html"):
"""Render CommonMark into HTML, JSON or AST
Optional keyword arguments:
format: 'html' (default), 'json' or 'ast'

>>> commonmark("*hello!*")
'<p><em>hello</em></p>\n'
"""
parser = Parser()
ast = parser.parse(text)
if format not in ["html", "json", "ast", "rst"]:
raise ValueError("format must be 'html', 'json' or 'ast'")
if format == "html":
renderer = HtmlRenderer()
return renderer.render(ast)
if format == "json":
return dumpJSON(ast)
if format == "ast":
return dumpAST(ast)
if format == "rst":
renderer = ReStructuredTextRenderer()
return renderer.render(ast)


I don't know how to proceed, could you please help me to run the python application. I really appreciate your kind help.



Thank you
Venu










share|improve this question
















Very good morning. I am trying to install a simple python app for contentful. I downloaded it from this GitHub repo. When I try to launch the application using "make run" command, it is giving me the following error:



E:contentfulpythonthe-example-app.py>make run
python app.py
Traceback (most recent call last):
File "app.py", line 10, in <module>
from lib.markdown import markdown
File "E:contentfulpythonthe-example-app.pylibmarkdown.py", line 1, in <module>
import CommonMark
File "C:UsersadminAppDataLocalProgramsPythonPython38libsite-packagesCommonMark__init__.py", line 4, in <module>
from commonmark.main import commonmark
ModuleNotFoundError: No module named 'commonmark'
make: *** [run] Error 1


I am not sure how to go about this error. I found a main.py within the CommonMark folder. The main.py code looks like below.



# 2014 - Bibek Kafle & Roland Shoemaker
# 2015-2017 - Nikolas Nyby
# Port of @jgm's commonmark.js implementation of the CommonMark spec.

# Basic usage:
#
# import commonmark
# parser = commonmark.Parser()
# renderer = commonmark.HtmlRenderer()
# print(renderer.render(parser.parse('Hello *world*')))

from __future__ import absolute_import, unicode_literals

from commonmark.blocks import Parser
from commonmark.dump import dumpAST, dumpJSON
from commonmark.render.html import HtmlRenderer
from commonmark.render.rst import ReStructuredTextRenderer


def commonmark(text, format="html"):
"""Render CommonMark into HTML, JSON or AST
Optional keyword arguments:
format: 'html' (default), 'json' or 'ast'

>>> commonmark("*hello!*")
'<p><em>hello</em></p>\n'
"""
parser = Parser()
ast = parser.parse(text)
if format not in ["html", "json", "ast", "rst"]:
raise ValueError("format must be 'html', 'json' or 'ast'")
if format == "html":
renderer = HtmlRenderer()
return renderer.render(ast)
if format == "json":
return dumpJSON(ast)
if format == "ast":
return dumpAST(ast)
if format == "rst":
renderer = ReStructuredTextRenderer()
return renderer.render(ast)


I don't know how to proceed, could you please help me to run the python application. I really appreciate your kind help.



Thank you
Venu







python commonmark






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 10 at 8:32









Benyamin Jafari

3,59342351




3,59342351










asked Feb 10 at 7:35









user2368975user2368975

183




183




migrated from superuser.com Feb 10 at 8:12


This question came from our site for computer enthusiasts and power users.









migrated from superuser.com Feb 10 at 8:12


This question came from our site for computer enthusiasts and power users.










  • 1





    Maybe you either haven't installed commonmark properly or you have an old version? github.com/rtfd/CommonMark-py/issues/137. Either way reinstall or upgrade commonmark.

    – Atirag
    Feb 10 at 8:43
















  • 1





    Maybe you either haven't installed commonmark properly or you have an old version? github.com/rtfd/CommonMark-py/issues/137. Either way reinstall or upgrade commonmark.

    – Atirag
    Feb 10 at 8:43










1




1





Maybe you either haven't installed commonmark properly or you have an old version? github.com/rtfd/CommonMark-py/issues/137. Either way reinstall or upgrade commonmark.

– Atirag
Feb 10 at 8:43







Maybe you either haven't installed commonmark properly or you have an old version? github.com/rtfd/CommonMark-py/issues/137. Either way reinstall or upgrade commonmark.

– Atirag
Feb 10 at 8:43














0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54614580%2ffrom-commonmark-main-import-commonmark-throws-modulenotfounderror-no-module-n%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54614580%2ffrom-commonmark-main-import-commonmark-throws-modulenotfounderror-no-module-n%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to make a Squid Proxy server?

Is this a new Fibonacci Identity?

19世紀