Sphinx >=1.7.0 breaks help on Windows with a working dir on a drive different from the Python install drive
See original GitHub issueI faced this error while I was coding (typing) in the editor:
after closing it, the Spyder continues to its normal operation, I did not see any after effect.
Windows 10 - Python 3.6.4. The Spyder 3.2.7
was installed using Anaconda
Issue Analytics
- State:
- Created 6 years ago
- Comments:23 (13 by maintainers)
Top Results From Across the Web
Windows Sphinx installation failed... what went wrong?
I'm following the instructions in Installing Sphinx - Windows. Python 2.7 has priority in my system path, but Python 3.8 is on my...
Read more >Documentation » Installing Sphinx
Installation from PyPI On Linux or MacOS, you should open your terminal and run the following command. On Windows, you should open Command...
Read more >Sphinx Documentation - Read the Docs
Most Windows users do not have Python installed by default, so we begin with the installation of Python itself. If you are unsure, ......
Read more >Considerations in adopting RHEL 8 Red Hat Enterprise Linux 8
Red Hat Enterprise Linux 8 supports installing from a repository on a local hard drive. Previously, the only installation method from a hard...
Read more >Changelog - pip documentation v22.3.1
Deprecate --install-options which forces pip to use the deprecated install ... slash from a file:// URL built from an path with the Windows...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This error message is fired in C:\Python27\Lib\site-packages\spyder\plugins\help.py when an exception in method
run
of classSphinxThread
is handled by thetry: except:
blocksThis handling prevents the full traceback been shown in Spyder’s Internal terminal If you deactivate the try-except, the traceback appears:
The problem explained
build
method of classSphinx
c:\Python27\Lib\site-packages\sphinx\application.py circa line 343 Callspath.relpath
(os.path.relpath
, in Windows defined in c:\python27\lib\ntpath.py ) with a single argument, some temporary dir usually in C:\relpath
uses second argument’s default ‘.’, the python current working dir, sayos.getcwd()
relpath
fires aValueError
if called with paths from different drives. So if Spyder’s working dir (python current working dir) is not in drive C: , the exception is firedWhy once per session
This exception switches help display mode from richt text to plain text
plain text mode doesnt use Sphinx, so the problem dissapears unless you switch back to richt text mode.
SOLUTIONS
Being involved Sphinx, Spyder and ntpath.py, there are various options
Patch ntpath.py You could patch
relpath
in c:\python27\lib\ntpath.py , but this could be dangerous, other scripts can expect this exception been fired and handle it their own way.Patch Sphinx (my choose) c:\Python27\Lib\site-packages\sphinx\application.py this way
from sphinx.application import Sphinx
insert thisWarning: Seems to override
relpath
in all Spyder app modules, not only in sphinx.applicationI can confirm that all sphinx help is in fact broken (not showing the tutorial, etc. at all, and only showing plain text of docstrings for Sphinx 1.7.0+ on Windows under the above stated conditions. I can confirm Sphinx <= 1.6.6 is unaffected, so the location for now is to downgrade to that with
conda install sphinx=1.6.6
from the Anaconda prompt (or just don’t use a working directory different from your Python/Anaconda install).