I'm documenting my project using Sphinx and upon build I get the following error
I get the error
Running Sphinx v1.6.5
Extension error:
Could not import extension sphinx.builders.latex (exception: cannot import name 'EscapeFormatter')
make: *** [html] Error 1
Is there any workaround or do I've to install any extentions manually?
PS: I even tried adding the sphinx.builders.latex extention in the conf.py file, it still didnt work.
It says exception: cannot import name 'EscapeFormatter'.
It is a part of markupsafe library which Sphinx depends on. How did you install Sphinx?
I guess this is an issue of installing.
sudo -H pip3 install Sphinx
Please let me know the result of pip3 list and python3 -c 'from markupsafe import EscapeFormatter'
Output of pip3 list
alabaster (0.7.10)
apturl (0.5.2ubuntu4)
Babel (2.5.1)
Brlapi (0.6.1)
certifi (2017.7.27.1)
chardet (2.2.1)
checkbox-ng (0.3)
checkbox-support (0.2)
colorama (0.2.5)
defer (1.0.6)
docutils (0.14)
feedparser (5.1.3)
friends (0.1)
html5lib (0.999)
httplib2 (0.8)
idna (2.6)
imagesize (0.7.1)
Jinja2 (2.9.6)
language-selector (0.1)
louis (2.5.3)
lxml (3.3.3)
Mako (0.9.1)
MarkupSafe (0.18)
oauthlib (0.6.1)
onboard (1.0.1)
oneconf (0.3.7.14.04.1)
pip (1.5.4)
piston-mini-client (0.7.5)
plainbox (0.5.3)
pycrypto (2.6.1)
pycurl (7.19.3)
Pygments (2.2.0)
pygobject (3.12.0)
pyparsing (2.0.1)
python-apt (0.9.3.5ubuntu2)
python-debian (0.1.21-nmu2ubuntu2)
pytz (2017.2)
pyxdg (0.25)
requests (2.2.1)
setuptools (3.3)
six (1.5.2)
snowballstemmer (1.2.1)
software-center-aptd-plugins (0.0.0)
Sphinx (1.6.5)
sphinx-rtd-theme (0.2.4)
sphinxcontrib-websupport (1.0.1)
typing (3.6.2)
ubuntu-drivers-common (0.0.0)
unattended-upgrades (0.1)
unity-scope-audacious (0.1)
unity-scope-calculator (0.1)
unity-scope-chromiumbookmarks (0.1)
unity-scope-clementine (0.1)
unity-scope-colourlovers (0.1)
unity-scope-devhelp (0.1)
unity-scope-firefoxbookmarks (0.1)
unity-scope-gdrive (0.7)
unity-scope-gmusicbrowser (0.1)
unity-scope-gourmet (0.1)
unity-scope-guayadeque (0.1)
unity-scope-manpages (0.1)
unity-scope-musique (0.1)
unity-scope-openclipart (0.1)
unity-scope-texdoc (0.1)
unity-scope-tomboy (0.1)
unity-scope-virtualbox (0.1)
unity-scope-yelp (0.1)
unity-scope-zotero (0.1)
urllib3 (1.7.1)
usb-creator (0.2.23)
wheel (0.24.0)
xdiagnose (3.6.3build2)
xkit (0.0.0)
Output of python3 -c 'from markupsafe import
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: cannot import name 'EscapeFormatter'
Jinja2 (2.9.6)
MarkupSafe (0.18)
It seems version mismatch. Jinja2 requires MarkupSafe>=0.23.
https://github.com/pallets/jinja/blob/2.9.6/setup.py#L72
Please upgrade MarkupSafe or downgrade Jinja2.
Anyway, this is not a bug of Sphinx. So I'm closing this now.
If you still have problem, please post to sphinx-users forum.
https://groups.google.com/forum/#!forum/sphinx-users
Thanks,
What about this one,
buildworker 2 % pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable
this warning.
alabaster (0.7.10)
appdirs (1.4.3)
asn1crypto (0.23.0)
attrs (17.3.0)
autobahn (17.10.1)
Automat (0.6.0)
Babel (2.4.0)
backports.ssl-match-hostname (3.4.0.2)
boto (2.45.0)
buildbot (0.9.14)
buildbot-console-view (0.9.14)
buildbot-grid-view (0.9.14)
buildbot-waterfall-view (0.9.14)
buildbot-worker (0.9.14)
buildbot-www (0.9.14)
certifi (2017.11.5)
cffi (1.11.2)
chardet (3.0.4)
Cheetah (2.4.4)
cloud-init (0.7.9)
configobj (4.7.2)
constantly (15.1.0)
cryptography (2.1.2)
decorator (4.1.2)
docutils (0.13.1)
enum34 (1.1.6)
future (0.16.0)
hyperlink (17.3.1)
idna (2.6)
imagesize (0.7.1)
incremental (17.5.0)
iniparse (0.4)
ipaddress (1.0.18)
IPy (0.75)
Jinja2 (2.10)
jsonpatch (1.2)
jsonpointer (1.9)
kitchen (1.1.1)
Markdown (2.4.1)
MarkupSafe (1.0)
packaging (16.8)
pbr (3.1.1)
perf (0.1)
Pillow (2.0.0)
pip (9.0.1)
policycoreutils-default-encoding (0.1)
prettytable (0.7.2)
pyasn1 (0.3.7)
pyasn1-modules (0.1.5)
pycparser (2.18)
pycurl (7.19.0)
Pygments (2.2.0)
pygobject (3.22.0)
pygpgme (0.3)
PyJWT (1.5.3)
pyliblzma (0.5.3)
pyOpenSSL (17.3.0)
pyparsing (2.2.0)
pyserial (2.6)
python-dateutil (2.6.1)
python-linux-procfs (0.4.9)
pytz (2017.2)
pyudev (0.15)
pyxattr (0.5.1)
PyYAML (3.10)
requests (2.18.4)
rsa (3.4.1)
schedutils (0.4)
seobject (0.1)
sepolicy (1.1)
service-identity (17.0.0)
setuptools (38.2.5)
six (1.11.0)
snowballstemmer (1.2.1)
Sphinx (1.6.2)
sphinx-rtd-theme (0.2.4)
sphinxcontrib-websupport (1.0.1)
SQLAlchemy (1.2.0)
sqlalchemy-migrate (0.11.0)
sqlparse (0.2.4)
Tempita (0.5.2)
treq (17.8.0)
Twisted (17.9.0)
Twisted-Core (12.2.0)
txaio (2.8.2)
typing (3.6.1)
urlgrabber (3.10)
urllib3 (1.22)
yum-metadata-parser (1.1.4)
zope.interface (4.4.3)
Python version 2.7.5
OS Centos 7
pip uninstall markupsafe
pip install markupsafe==0.23
solved the problem