I installed Pandoc and the requirements as listed in the
requirements.txt file from the r-novice-gapminder lesson, but I get an
error about a missing function in CommonMark.

I ran

$ pip install -r requirements.txt

using a freshly downloaded Anaconda2 (and again with Anaconda3, just
in case), and that went fine.  CommonMark 0.6.3 is installed.
However, running make from the r-novice-gapminder folder throws the
error

AttributeError: 'module' object has no attribute 'DocParser'

Below is a transcript showing the pip install, an IPython session
where I used Tab-completion to list the contents of CommonMark, and
finally the output of make.

It actually appears that other make targets work, though I'm not
entirely clear on the process for R, as make didn't seem to run the
.Rmd file through knitr.  I am missing something obvious.  What?

Thanks,  -- bennet

Transcript
----

[stentorian:r-novice-gapminder bennet]$ pip install -r requirements.txt
Collecting CommonMark (from -r requirements.txt (line 1))
  Using cached CommonMark-0.6.3-py2.py3-none-any.whl
Collecting pandocfilters (from -r requirements.txt (line 2))
  Downloading pandocfilters-1.3.0.tar.gz
Requirement already satisfied (use --upgrade to upgrade): PyYAML in
/Users/bennet/anaconda2/lib/python2.7/site-packages (from -r
requirements.txt (line 3))
Collecting update-copyright (from -r requirements.txt (line 4))
  Downloading update-copyright-0.6.2.tar.gz
Collecting future (from CommonMark->-r requirements.txt (line 1))
  Using cached future-0.15.2.tar.gz
Building wheels for collected packages: pandocfilters, update-copyright, future
  Running setup.py bdist_wheel for pandocfilters ... done
  Stored in directory:
/Users/bennet/Library/Caches/pip/wheels/f0/45/06/df26739ffe8b804ab4be4ffb0b93cdcc95d4497648a9ec9547
  Running setup.py bdist_wheel for update-copyright ... done
  Stored in directory:
/Users/bennet/Library/Caches/pip/wheels/2b/94/1f/f9fb3104df8bb64b0dbbd4254623fccb7772231afb6d6f9ce2
  Running setup.py bdist_wheel for future ... done
  Stored in directory:
/Users/bennet/Library/Caches/pip/wheels/d9/04/36/6bd807b5148e7c929d8f0991cc943a81f3287030a1b352e3fc
Successfully built pandocfilters update-copyright future
Installing collected packages: future, CommonMark, pandocfilters,
update-copyright
Successfully installed CommonMark-0.6.3 future-0.15.2
pandocfilters-1.3.0 update-copyright-0.6.2


[stentorian:r-novice-gapminder bennet]$ which python
/Users/bennet/anaconda2/bin/python


[stentorian:r-novice-gapminder bennet]$ make check
python tools/check.py .
Traceback (most recent call last):
  File "tools/check.py", line 845, in <module>
    main(parsed_args)
  File "tools/check.py", line 830, in main
    res = validate_single(fn, template=template)
  File "tools/check.py", line 710, in validate_single
    validate_file = validator(filepath)
  File "tools/check.py", line 80, in __init__
    ast = self._parse_markdown(self.markdown)
  File "tools/check.py", line 87, in _parse_markdown
    parser = CommonMark.DocParser()
AttributeError: 'module' object has no attribute 'DocParser'
make: *** [check] Error 1


[stentorian:r-novice-gapminder bennet]$ ipython
Python 2.7.11 |Anaconda 4.0.0 (x86_64)| (default, Dec  6 2015, 18:57:58)
Type "copyright", "credits" or "license" for more information.

IPython 4.1.2 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import CommonMark

In [2]: CommonMark.
CommonMark.ASTtoJSON         CommonMark.commonmark
CommonMark.CommonMark        CommonMark.dumpAST
CommonMark.HtmlRenderer      CommonMark.entitytrans
CommonMark.Parser            CommonMark.html
CommonMark.absolute_import   CommonMark.inlines
CommonMark.blocks            CommonMark.node
CommonMark.common            CommonMark.unicode_literals

In [2]: exit

_______________________________________________
Discuss mailing list
[email protected]
http://lists.software-carpentry.org/mailman/listinfo/discuss_lists.software-carpentry.org

Reply via email to