sphinx-build Not found in "sudo"

154 views
Skip to first unread message

Ramesh Babu.R

unread,
Jul 31, 2021, 10:45:26 PM7/31/21
to sphinx-users

Hi, We are facing an issue where "make html" fails when executing from "sudo python" location.
Same command works when python was sourced without sudo. Any pointers would be helpful.

Fails when executing from sudo:

[jenkins@jenkins BUILD_TAG_validate_Fri_Jul_30_15_31_30_2021_]$ sudo /opt/cisco/aci/python2.7/bin/python

Python 2.7.14 (default, Apr 12 2018, 19:30:39) 

[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import os

>>> os.system('make html')

sphinx-build -b html -d _build/doctrees   . _build/html

make: sphinx-build: Command not found

make: *** [html] Error 127

512

>>>

Works without sudo:

[jenkins@jenkins BUILD_TAG_validate_Fri_Jul_30_15_31_30_2021_]$ /opt/cisco/aci/python2.7/bin/python

Python 2.7.14 (default, Apr 12 2018, 19:30:39) 

[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import os

>>> os.system('make html')

sphinx-build -b html -d _build/doctrees   . _build/html

Running Sphinx v1.8.5

loading pickled environment... done

building [mo]: targets for 0 po files that are out of date

building [html]: targets for 0 source files that are out of date

updating environment: 0 added, 0 changed, 0 removed

looking for now-outdated files... none found

no targets are out of date.

build succeeded.

 

The HTML pages are in _build/html.

 

Build finished. The HTML pages are in _build/html.

0

>>>

Komiya Takeshi

unread,
Jul 31, 2021, 11:03:18 PM7/31/21
to sphinx...@googlegroups.com
Hi,

I guess you installed Sphinx into user space. So python could not find
the sphinx-build command.
Please check how you installed it. And please do "sudo pip install
Sphinx==1.8.5" if you'd like to run Sphinx under sudo.

FYI: Bot python2.7 and sphinx1.8 have been already deprecated. So it
would be better to use newer ones.

Thanks,
Takeshi KOMIYA

2021年8月1日(日) 11:45 Ramesh Babu.R <rrba...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/c8ee4c7f-dab8-43fd-8b64-b9cf8a6a0667n%40googlegroups.com.

Darren Ng

unread,
Aug 4, 2021, 7:10:27 AM8/4/21
to sphinx-users
> [jenkins@jenkins BUILD_TAG_validate_Fri_Jul_30_15_31_30_2021_]$ sudo /opt/cisco/aci/python2.7/bin/python
> sphinx-build -b html -d _build/doctrees   . _build/html
> make: sphinx-build: Command not found

> Works without sudo:

> [jenkins@jenkins BUILD_TAG_validate_Fri_Jul_30_15_31_30_2021_]$ /opt/cisco/aci/python2.7/bin/python
> sphinx-build -b html -d _build/doctrees   . _build/html
> Running Sphinx v1.8.5

You can use some dangerous path hack w/o touching tha pip rabbit hole

   1. Locate your sphinx-build with ``$ type sphinx-build``
      or ``$ which sphinx-build``

   2. Add its location to sudo ``secure_path``

Thanks,
Darren Ng
2021-08-04 WITA

Reply all
Reply to author
Forward
0 new messages