[petsc-dev] Sphinx error

Lisandro Dalcin dalcinl at gmail.com
Thu Jul 9 11:56:06 CDT 2020


On Tue, 7 Jul 2020 at 15:18, Barry Smith <bsmith at petsc.dev> wrote:

>   "Any Python package that you install with brew will install the Homebrew
> Python build."
>
>   Sure in general with python on Apple, but you ignored my statement:
>
> $ which sphinx-build
> /usr/local/opt/sphinx-doc/bin/sphinx-build
> ~/Src/petsc/src/ksp/ksp/interface* (master=)* arch-master
> $ more /usr/local/opt/sphinx-doc/bin/sphinx-build
> #!/usr/local/Cellar/sphinx-doc/3.0.4/libexec/bin/python3.8
> # -*- coding: utf-8 -*-
> import re
> import sys
> from sphinx.cmd.build import main
>
> sphinx seems to be carrying around its own python internally, thus quite
> rightly getting Jed upset about packaging on Apple of open source
> software.  Or perhaps I misunderstand that line.
>
>
Oh, sorry, now I understand what you mean! You are right, but anyway you
still have a bit of mess around:

1) Run `brew info sphinx-doc` and read the "Caveats" section. Long story
short, that package is not meant to be used for regular users.
Get rid of it with `brew uninstall sphinx-doc`. Open a new terminal and
make sure you don't have /usr/local/opt/sphinx-doc/bin from $PATH.

2) Install Homebrew Python with `brew install python` (or maybe python3, do
not remember right now, but "python" should be enough).
Or try `brew upgrade python` if you are in py3.7, this way you should get
py3.8.
Consider symlinking python3 -> python in /usr/local/bin (or maybe ~/bin, if
you prefer).
Otherwise, if you do not symlink, you will forget and keep using plain
"python" in the command line, and that one will be EOLed system Apple
Python 2.7.

3) Finally, just use pip to install sphinx `python3 -m pip install sphinx`.
Now `which sphinx-build` should point to /usr/local/bin.

PS: 99% of Python packages, and particularly the pure-Python ones, can  be
installed with pip under Homebrew Python. Go this way ASAP and forget about
system Apple Python.


-- 
Lisandro Dalcin
============
Research Scientist
Extreme Computing Research Center (ECRC)
King Abdullah University of Science and Technology (KAUST)
http://ecrc.kaust.edu.sa/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20200709/6ed56b38/attachment.html>


More information about the petsc-dev mailing list