Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named doc8 #2947

Closed
RFRIEDM-Trimble opened this issue Aug 15, 2022 · 3 comments
Closed

No module named doc8 #2947

RFRIEDM-Trimble opened this issue Aug 15, 2022 · 3 comments

Comments

@RFRIEDM-Trimble
Copy link
Contributor

During my contribution of this PR #2882, I was unable to build docs due to an issue with finding doc8. I followed the developer instructions exactly. This can easily be fixed by first referencing the user's python interpreter prior to invoking the call to doc8, so it knows where to find it. I will propose a simple fix.

@RFRIEDM-Trimble
Copy link
Contributor Author

For a full log trace, it appears to be due to incompatible versions of doc8.

Rfriedm@rfriedm-us-ll2:~/Development/RFRIEDM-Trimble/ros2_documentation$ python3 -m pip install -r requirements.txt 
Collecting doc8
  Downloading doc8-1.0.0-py3-none-any.whl (25 kB)
Requirement already satisfied: docutils==0.16 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 2)) (0.16)
Requirement already satisfied: pip in /usr/lib/python3/dist-packages (from -r requirements.txt (line 3)) (20.0.2)
Collecting sphinx
  Downloading Sphinx-5.1.1-py3-none-any.whl (3.2 MB)
     |████████████████████████████████| 3.2 MB 2.3 MB/s 
Collecting sphinx-copybutton
  Downloading sphinx_copybutton-0.5.0-py3-none-any.whl (12 kB)
Collecting sphinx-multiversion
  Downloading sphinx_multiversion-0.2.4-py3-none-any.whl (9.6 kB)
Collecting sphinx-rtd-theme
  Downloading sphinx_rtd_theme-1.0.0-py2.py3-none-any.whl (2.8 MB)
     |████████████████████████████████| 2.8 MB 2.2 MB/s 
Collecting sphinx-sitemap
  Downloading sphinx-sitemap-2.2.0.tar.gz (6.1 kB)
Collecting sphinx-tabs
  Downloading sphinx_tabs-3.4.1-py3-none-any.whl (10.0 kB)
Requirement already satisfied: Pygments in /usr/lib/python3/dist-packages (from doc8->-r requirements.txt (line 1)) (2.3.1)
Collecting stevedore
  Downloading stevedore-4.0.0-py3-none-any.whl (49 kB)
     |████████████████████████████████| 49 kB 2.2 MB/s 
Collecting tomli; python_version < "3.11"
  Downloading tomli-2.0.1-py3-none-any.whl (12 kB)
Collecting restructuredtext-lint>=0.7
  Downloading restructuredtext_lint-1.4.0.tar.gz (16 kB)
Requirement already satisfied: requests>=2.5.0 in /usr/lib/python3/dist-packages (from sphinx->-r requirements.txt (line 4)) (2.22.0)
Collecting sphinxcontrib-devhelp
  Downloading sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl (84 kB)
     |████████████████████████████████| 84 kB 1.7 MB/s 
Collecting Jinja2>=2.3
  Downloading Jinja2-3.1.2-py3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 2.8 MB/s 
Collecting sphinxcontrib-jsmath
  Downloading sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl (5.1 kB)
Collecting sphinxcontrib-serializinghtml>=1.1.5
  Downloading sphinxcontrib_serializinghtml-1.1.5-py2.py3-none-any.whl (94 kB)
     |████████████████████████████████| 94 kB 1.9 MB/s 
Collecting importlib-metadata>=4.4; python_version < "3.10"
  Downloading importlib_metadata-4.12.0-py3-none-any.whl (21 kB)
Collecting snowballstemmer>=1.1
  Downloading snowballstemmer-2.2.0-py2.py3-none-any.whl (93 kB)
     |████████████████████████████████| 93 kB 837 kB/s 
Collecting babel>=1.3
  Downloading Babel-2.10.3-py3-none-any.whl (9.5 MB)
     |████████████████████████████████| 9.5 MB 1.7 MB/s 
Collecting sphinxcontrib-qthelp
  Downloading sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl (90 kB)
     |████████████████████████████████| 90 kB 2.2 MB/s 
Collecting alabaster<0.8,>=0.7
  Downloading alabaster-0.7.12-py2.py3-none-any.whl (14 kB)
Collecting imagesize
  Downloading imagesize-1.4.1-py2.py3-none-any.whl (8.8 kB)
Collecting sphinxcontrib-htmlhelp>=2.0.0
  Downloading sphinxcontrib_htmlhelp-2.0.0-py2.py3-none-any.whl (100 kB)
     |████████████████████████████████| 100 kB 2.1 MB/s 
Collecting sphinxcontrib-applehelp
  Downloading sphinxcontrib_applehelp-1.0.2-py2.py3-none-any.whl (121 kB)
     |████████████████████████████████| 121 kB 2.1 MB/s 
Requirement already satisfied: packaging in /usr/lib/python3/dist-packages (from sphinx->-r requirements.txt (line 4)) (20.3)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from sphinx-sitemap->-r requirements.txt (line 8)) (1.14.0)
Collecting pbr!=2.1.0,>=2.0.0
  Downloading pbr-5.10.0-py2.py3-none-any.whl (112 kB)
     |████████████████████████████████| 112 kB 2.1 MB/s 
Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-2.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Collecting zipp>=0.5
  Downloading zipp-3.8.1-py3-none-any.whl (5.6 kB)
Requirement already satisfied: pytz>=2015.7 in /usr/lib/python3/dist-packages (from babel>=1.3->sphinx->-r requirements.txt (line 4)) (2019.3)
Building wheels for collected packages: sphinx-sitemap, restructuredtext-lint
  Building wheel for sphinx-sitemap (setup.py) ... done
  Created wheel for sphinx-sitemap: filename=sphinx_sitemap-2.2.0-py3-none-any.whl size=6063 sha256=3af74cb0bf47b758d5775eabcbc73a30bc0604ff55477ca37f587e390354e3c0
  Stored in directory: /home/Rfriedm/.cache/pip/wheels/85/39/10/28004813bd2888b66a6a9b6bc3a39d77357fda8788d16b97db
  Building wheel for restructuredtext-lint (setup.py) ... done
  Created wheel for restructuredtext-lint: filename=restructuredtext_lint-1.4.0-py3-none-any.whl size=13793 sha256=a7b704a455ecafb786a75933709dd9f29412d3e4b4f0a7d8c410e59459fb5d47
  Stored in directory: /home/Rfriedm/.cache/pip/wheels/b6/9d/8a/31f24f45d7b026ec9ca2dc1626c8d1229063351d1cae47284a
Successfully built sphinx-sitemap restructuredtext-lint
ERROR: doc8 1.0.0 has requirement docutils<0.21,>=0.19, but you'll have docutils 0.16 which is incompatible.
ERROR: sphinx-tabs 3.4.1 has requirement docutils~=0.18.0, but you'll have docutils 0.16 which is incompatible.
Installing collected packages: pbr, stevedore, tomli, restructuredtext-lint, doc8, sphinxcontrib-devhelp, MarkupSafe, Jinja2, sphinxcontrib-jsmath, sphinxcontrib-serializinghtml, zipp, importlib-metadata, snowballstemmer, babel, sphinxcontrib-qthelp, alabaster, imagesize, sphinxcontrib-htmlhelp, sphinxcontrib-applehelp, sphinx, sphinx-copybutton, sphinx-multiversion, sphinx-rtd-theme, sphinx-sitemap, sphinx-tabs
  WARNING: The script pbr is installed in '/home/Rfriedm/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The scripts restructuredtext-lint and rst-lint are installed in '/home/Rfriedm/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script doc8 is installed in '/home/Rfriedm/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script pybabel is installed in '/home/Rfriedm/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The scripts sphinx-apidoc, sphinx-autogen, sphinx-build and sphinx-quickstart are installed in '/home/Rfriedm/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script sphinx-multiversion is installed in '/home/Rfriedm/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed Jinja2-3.1.2 MarkupSafe-2.1.1 alabaster-0.7.12 babel-2.10.3 doc8-1.0.0 imagesize-1.4.1 importlib-metadata-4.12.0 pbr-5.10.0 restructuredtext-lint-1.4.0 snowballstemmer-2.2.0 sphinx-5.1.1 sphinx-copybutton-0.5.0 sphinx-multiversion-0.2.4 sphinx-rtd-theme-1.0.0 sphinx-sitemap-2.2.0 sphinx-tabs-3.4.1 sphinxcontrib-applehelp-1.0.2 sphinxcontrib-devhelp-1.0.2 sphinxcontrib-htmlhelp-2.0.0 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.3 sphinxcontrib-serializinghtml-1.1.5 stevedore-4.0.0 tomli-2.0.1 zipp-3.8.1
Rfriedm@rfriedm-us-ll2:~/Development/RFRIEDM-Trimble/ros2_documentation$ make test
doc8 --ignore D001 --ignore-path build
make: doc8: Command not found
make: *** [Makefile:22: test] Error 127
Rfriedm@rfriedm-us-ll2:~/Development/RFRIEDM-Trimble/ros2_documentation$ pip3 install --user --upgrade -r requirements.txt
Requirement already up-to-date: doc8 in /home/Rfriedm/.local/lib/python3.8/site-packages (from -r requirements.txt (line 1)) (1.0.0)
Requirement already up-to-date: docutils==0.16 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 2)) (0.16)
Collecting pip
  Downloading pip-22.2.2-py3-none-any.whl (2.0 MB)
     |████████████████████████████████| 2.0 MB 612 kB/s 
Requirement already up-to-date: sphinx in /home/Rfriedm/.local/lib/python3.8/site-packages (from -r requirements.txt (line 4)) (5.1.1)
Requirement already up-to-date: sphinx-copybutton in /home/Rfriedm/.local/lib/python3.8/site-packages (from -r requirements.txt (line 5)) (0.5.0)
Requirement already up-to-date: sphinx-multiversion in /home/Rfriedm/.local/lib/python3.8/site-packages (from -r requirements.txt (line 6)) (0.2.4)
Requirement already up-to-date: sphinx-rtd-theme in /home/Rfriedm/.local/lib/python3.8/site-packages (from -r requirements.txt (line 7)) (1.0.0)
Requirement already up-to-date: sphinx-sitemap in /home/Rfriedm/.local/lib/python3.8/site-packages (from -r requirements.txt (line 8)) (2.2.0)
Requirement already up-to-date: sphinx-tabs in /home/Rfriedm/.local/lib/python3.8/site-packages (from -r requirements.txt (line 9)) (3.4.1)
Requirement already satisfied, skipping upgrade: Pygments in /usr/lib/python3/dist-packages (from doc8->-r requirements.txt (line 1)) (2.3.1)
Requirement already satisfied, skipping upgrade: tomli; python_version < "3.11" in /home/Rfriedm/.local/lib/python3.8/site-packages (from doc8->-r requirements.txt (line 1)) (2.0.1)
Requirement already satisfied, skipping upgrade: stevedore in /home/Rfriedm/.local/lib/python3.8/site-packages (from doc8->-r requirements.txt (line 1)) (4.0.0)
Requirement already satisfied, skipping upgrade: restructuredtext-lint>=0.7 in /home/Rfriedm/.local/lib/python3.8/site-packages (from doc8->-r requirements.txt (line 1)) (1.4.0)
Requirement already satisfied, skipping upgrade: importlib-metadata>=4.4; python_version < "3.10" in /home/Rfriedm/.local/lib/python3.8/site-packages (from sphinx->-r requirements.txt (line 4)) (4.12.0)
Requirement already satisfied, skipping upgrade: snowballstemmer>=1.1 in /home/Rfriedm/.local/lib/python3.8/site-packages (from sphinx->-r requirements.txt (line 4)) (2.2.0)
Requirement already satisfied, skipping upgrade: sphinxcontrib-devhelp in /home/Rfriedm/.local/lib/python3.8/site-packages (from sphinx->-r requirements.txt (line 4)) (1.0.2)
Requirement already satisfied, skipping upgrade: requests>=2.5.0 in /usr/lib/python3/dist-packages (from sphinx->-r requirements.txt (line 4)) (2.22.0)
Requirement already satisfied, skipping upgrade: packaging in /usr/lib/python3/dist-packages (from sphinx->-r requirements.txt (line 4)) (20.3)
Requirement already satisfied, skipping upgrade: sphinxcontrib-jsmath in /home/Rfriedm/.local/lib/python3.8/site-packages (from sphinx->-r requirements.txt (line 4)) (1.0.1)
Requirement already satisfied, skipping upgrade: imagesize in /home/Rfriedm/.local/lib/python3.8/site-packages (from sphinx->-r requirements.txt (line 4)) (1.4.1)
Requirement already satisfied, skipping upgrade: sphinxcontrib-htmlhelp>=2.0.0 in /home/Rfriedm/.local/lib/python3.8/site-packages (from sphinx->-r requirements.txt (line 4)) (2.0.0)
Requirement already satisfied, skipping upgrade: sphinxcontrib-serializinghtml>=1.1.5 in /home/Rfriedm/.local/lib/python3.8/site-packages (from sphinx->-r requirements.txt (line 4)) (1.1.5)
Requirement already satisfied, skipping upgrade: sphinxcontrib-qthelp in /home/Rfriedm/.local/lib/python3.8/site-packages (from sphinx->-r requirements.txt (line 4)) (1.0.3)
Requirement already satisfied, skipping upgrade: Jinja2>=2.3 in /home/Rfriedm/.local/lib/python3.8/site-packages (from sphinx->-r requirements.txt (line 4)) (3.1.2)
Requirement already satisfied, skipping upgrade: alabaster<0.8,>=0.7 in /home/Rfriedm/.local/lib/python3.8/site-packages (from sphinx->-r requirements.txt (line 4)) (0.7.12)
Requirement already satisfied, skipping upgrade: babel>=1.3 in /home/Rfriedm/.local/lib/python3.8/site-packages (from sphinx->-r requirements.txt (line 4)) (2.10.3)
Requirement already satisfied, skipping upgrade: sphinxcontrib-applehelp in /home/Rfriedm/.local/lib/python3.8/site-packages (from sphinx->-r requirements.txt (line 4)) (1.0.2)
Requirement already satisfied, skipping upgrade: six in /usr/lib/python3/dist-packages (from sphinx-sitemap->-r requirements.txt (line 8)) (1.14.0)
Requirement already satisfied, skipping upgrade: pbr!=2.1.0,>=2.0.0 in /home/Rfriedm/.local/lib/python3.8/site-packages (from stevedore->doc8->-r requirements.txt (line 1)) (5.10.0)
Requirement already satisfied, skipping upgrade: zipp>=0.5 in /home/Rfriedm/.local/lib/python3.8/site-packages (from importlib-metadata>=4.4; python_version < "3.10"->sphinx->-r requirements.txt (line 4)) (3.8.1)
Requirement already satisfied, skipping upgrade: MarkupSafe>=2.0 in /home/Rfriedm/.local/lib/python3.8/site-packages (from Jinja2>=2.3->sphinx->-r requirements.txt (line 4)) (2.1.1)
Requirement already satisfied, skipping upgrade: pytz>=2015.7 in /usr/lib/python3/dist-packages (from babel>=1.3->sphinx->-r requirements.txt (line 4)) (2019.3)
Installing collected packages: pip
  WARNING: The scripts pip, pip3 and pip3.8 are installed in '/home/Rfriedm/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-22.2.2
Rfriedm@rfriedm-us-ll2:~/Development/RFRIEDM-Trimble/ros2_documentation$ sudo apt install graphviz
[sudo] password for Rfriedm: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  docutils-common libmessaging-menu0 python3-botocore python3-docutils python3-jmespath python3-pyasn1 python3-roman python3-rsa python3-s3transfer
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libann0 libcdt5 libcgraph6 libgts-0.7-5 libgts-bin libgvc6 libgvpr2 liblab-gamut1 libpathplan4
Suggested packages:
  graphviz-doc
The following NEW packages will be installed:
  graphviz libann0 libcdt5 libcgraph6 libgts-0.7-5 libgts-bin libgvc6 libgvpr2 liblab-gamut1 libpathplan4
0 upgraded, 10 newly installed, 0 to remove and 6 not upgraded.
Need to get 1,880 kB of archives.
After this operation, 9,205 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 libann0 amd64 1.1.2+doc-7build1 [26.0 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 libcdt5 amd64 2.42.2-3build2 [18.7 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 libcgraph6 amd64 2.42.2-3build2 [41.3 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 libgts-0.7-5 amd64 0.7.6+darcs121130-4 [150 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 libpathplan4 amd64 2.42.2-3build2 [21.9 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 libgvc6 amd64 2.42.2-3build2 [647 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 libgvpr2 amd64 2.42.2-3build2 [167 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 liblab-gamut1 amd64 2.42.2-3build2 [177 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 graphviz amd64 2.42.2-3build2 [590 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 libgts-bin amd64 0.7.6+darcs121130-4 [41.3 kB]
Fetched 1,880 kB in 1s (1,300 kB/s)    
Selecting previously unselected package libann0.
(Reading database ... 198599 files and directories currently installed.)
Preparing to unpack .../0-libann0_1.1.2+doc-7build1_amd64.deb ...
Unpacking libann0 (1.1.2+doc-7build1) ...
Selecting previously unselected package libcdt5:amd64.
Preparing to unpack .../1-libcdt5_2.42.2-3build2_amd64.deb ...
Unpacking libcdt5:amd64 (2.42.2-3build2) ...
Selecting previously unselected package libcgraph6:amd64.
Preparing to unpack .../2-libcgraph6_2.42.2-3build2_amd64.deb ...
Unpacking libcgraph6:amd64 (2.42.2-3build2) ...
Selecting previously unselected package libgts-0.7-5:amd64.
Preparing to unpack .../3-libgts-0.7-5_0.7.6+darcs121130-4_amd64.deb ...
Unpacking libgts-0.7-5:amd64 (0.7.6+darcs121130-4) ...
Selecting previously unselected package libpathplan4:amd64.
Preparing to unpack .../4-libpathplan4_2.42.2-3build2_amd64.deb ...
Unpacking libpathplan4:amd64 (2.42.2-3build2) ...
Selecting previously unselected package libgvc6.
Preparing to unpack .../5-libgvc6_2.42.2-3build2_amd64.deb ...
Unpacking libgvc6 (2.42.2-3build2) ...
Selecting previously unselected package libgvpr2:amd64.
Preparing to unpack .../6-libgvpr2_2.42.2-3build2_amd64.deb ...
Unpacking libgvpr2:amd64 (2.42.2-3build2) ...
Selecting previously unselected package liblab-gamut1:amd64.
Preparing to unpack .../7-liblab-gamut1_2.42.2-3build2_amd64.deb ...
Unpacking liblab-gamut1:amd64 (2.42.2-3build2) ...
Selecting previously unselected package graphviz.
Preparing to unpack .../8-graphviz_2.42.2-3build2_amd64.deb ...
Unpacking graphviz (2.42.2-3build2) ...
Selecting previously unselected package libgts-bin.
Preparing to unpack .../9-libgts-bin_0.7.6+darcs121130-4_amd64.deb ...
Unpacking libgts-bin (0.7.6+darcs121130-4) ...
Setting up liblab-gamut1:amd64 (2.42.2-3build2) ...
Setting up libgts-0.7-5:amd64 (0.7.6+darcs121130-4) ...
Setting up libpathplan4:amd64 (2.42.2-3build2) ...
Setting up libann0 (1.1.2+doc-7build1) ...
Setting up libcdt5:amd64 (2.42.2-3build2) ...
Setting up libcgraph6:amd64 (2.42.2-3build2) ...
Setting up libgts-bin (0.7.6+darcs121130-4) ...
Setting up libgvc6 (2.42.2-3build2) ...
Setting up libgvpr2:amd64 (2.42.2-3build2) ...
Setting up graphviz (2.42.2-3build2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
Rfriedm@rfriedm-us-ll2:~/Development/RFRIEDM-Trimble/ros2_documentation$ make test
doc8 --ignore D001 --ignore-path build
make: doc8: Command not found
make: *** [Makefile:22: test] Error 127

Specifically, this excerpt:

ERROR: doc8 1.0.0 has requirement docutils<0.21,>=0.19, but you'll have docutils 0.16 which is incompatible.
ERROR: sphinx-tabs 3.4.1 has requirement docutils~=0.18.0, but you'll have docutils 0.16 which is incompatible.

@RFRIEDM-Trimble
Copy link
Contributor Author

RFRIEDM-Trimble commented Aug 17, 2022

The issue really can be found from this line:

Installing collected packages: pip
  WARNING: The scripts pip, pip3 and pip3.8 are installed in '/home/Rfriedm/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-locat

The following is a fix. Yes the version is not compatible, but the real issue was it not being on path. To fix, I added it to my bash_profile (which is source in ~/.bashrc)

Rfriedm@rfriedm-us-ll2:~/Development/RFRIEDM-Trimble/ros2_documentation$ tail -n 1 ~/.bash_profile
export PATH=$PATH:~/.local/bin

If the user invokes doc8 via python3 -m doc8 ... it works, but that's not portable to windows, and the python command doesn't exist by default on Linux Ubuntu 20.04.

@clalancette
Copy link
Contributor

Given that we closed the connected pull request, I'm going to go ahead and close this as well. If you think this is still a problem, please feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants