sphinx-contrib / fulltoc

Extension for Sphinx to make the sidebar show a full table of contents instead of just the local headings
Apache License 2.0
38 stars 19 forks source link

"TypeError: decoding Unicode is not supported" when trying to install using pip #8

Closed ramiabughazaleh closed 7 years ago

ramiabughazaleh commented 9 years ago

Hi.

Thank you for sphinxcontrib-fulltoc.

Windows 7 Enterprise 64-bit SP1 Python 2.7.9 (x86-64)

I installed sphinx using pip without error:

>pip install sphinx
Collecting Sphinx                                                                                              
  Downloading Sphinx-1.3.1-py2.py3-none-any.whl (1.3MB)                                                        
    100% |################################| 1.3MB 350kB/s                                                      
Collecting sphinx-rtd-theme<0.2,>=0.1 (from Sphinx)                                                            
  Downloading sphinx_rtd_theme-0.1.8-py2.py3-none-any.whl (418kB)                                              
    100% |################################| 421kB 890kB/s                                                      
Requirement already satisfied (use --upgrade to upgrade): colorama in c:\python27\lib\site-packages (from Sphin
x)                                                                                                             
Collecting snowballstemmer>=1.1 (from Sphinx)                                                                  
  Downloading snowballstemmer-1.2.0.tar.gz (49kB)                                                              
    100% |################################| 53kB 1.6MB/s                                                       
Requirement already satisfied (use --upgrade to upgrade): six>=1.4 in c:\python27\lib\site-packages (from Sphin
x)                                                                                                             
Collecting Pygments>=2.0 (from Sphinx)                                                                         
  Downloading Pygments-2.0.2-py2-none-any.whl (672kB)                                                          
    100% |################################| 675kB 203kB/s                                                      
Collecting docutils>=0.11 (from Sphinx)                                                                        
  Downloading docutils-0.12.tar.gz (1.6MB)                                                                     
    100% |################################| 1.6MB 267kB/s                                                      
Collecting babel>=1.3 (from Sphinx)                                                                            
  Downloading Babel-1.3.tar.gz (3.4MB)                                                                         
    100% |################################| 3.4MB 158kB/s                                                      
Requirement already satisfied (use --upgrade to upgrade): Jinja2>=2.3 in c:\python27\lib\site-packages (from Sp
hinx)                                                                                                          
Collecting alabaster<0.8,>=0.7 (from Sphinx)                                                                   
  Downloading alabaster-0.7.4-py2-none-any.whl                                                                 
Requirement already satisfied (use --upgrade to upgrade): pytz>=0a in c:\python27\lib\site-packages (from babel
>=1.3->Sphinx)                                                                                                 
Requirement already satisfied (use --upgrade to upgrade): markupsafe in c:\python27\lib\site-packages (from Jin
ja2>=2.3->Sphinx)                                                                                              
Installing collected packages: sphinx-rtd-theme, snowballstemmer, Pygments, docutils, babel, alabaster, Sphinx 
  Running setup.py install for snowballstemmer                                                                 
  Running setup.py install for docutils                                                                        
  Running setup.py install for babel                                                                           
Successfully installed Pygments-2.0.2 Sphinx-1.3.1 alabaster-0.7.4 babel-1.3 docutils-0.12 snowballstemmer-1.2.
0 sphinx-rtd-theme-0.1.8                                                                                       

But then when I trying installing sphinxcontrib-fulltoc, I get an error:

>pip install sphinxcontrib-fulltoc
Collecting sphinxcontrib-fulltoc
  Downloading sphinxcontrib-fulltoc-1.1.tar.gz
Installing collected packages: sphinxcontrib-fulltoc
  Running setup.py install for sphinxcontrib-fulltoc
    Complete output from command C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\rami~1.abu\\appdata\\local\\temp\\pip-build-mfyh2w\\sphinxcontrib-fulltoc\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\rami~1.abu\appdata\local\temp\pip-ienfui-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib
    creating build\lib\sphinxcontrib
    copying sphinxcontrib\fulltoc.py -> build\lib\sphinxcontrib
    copying sphinxcontrib\__init__.py -> build\lib\sphinxcontrib
    running egg_info
    writing sphinxcontrib_fulltoc.egg-info\PKG-INFO
    writing namespace_packages to sphinxcontrib_fulltoc.egg-info\namespace_packages.txt
    writing top-level names to sphinxcontrib_fulltoc.egg-info\top_level.txt
    writing dependency_links to sphinxcontrib_fulltoc.egg-info\dependency_links.txt
    [pbr] Reusing existing SOURCES.txt
    running install_lib
    copying sphinxcontrib/fulltoc.py -> C:\Python27\Lib\site-packages\sphinxcontrib
    Skipping installation of C:\Python27\Lib\site-packages\sphinxcontrib\__init__.py (namespace package)
    byte-compiling C:\Python27\Lib\site-packages\sphinxcontrib\fulltoc.py to fulltoc.pyc
    running install_egg_info
    Copying sphinxcontrib_fulltoc.egg-info to C:\Python27\Lib\site-packages\sphinxcontrib_fulltoc-1.1-py2.7.egg-info
    Installing C:\Python27\Lib\site-packages\sphinxcontrib_fulltoc-1.1-py2.7-nspkg.pth
    running install_scripts
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\rami~1.abu\appdata\local\temp\pip-build-mfyh2w\sphinxcontrib-fulltoc\setup.py", line 29, in <module>
        pbr=True)
      File "C:\Python27\lib\distutils\core.py", line 151, in setup
        dist.run_commands()
      File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
        cmd_obj.run()
      File "C:\Python27\lib\site-packages\pbr\packaging.py", line 203, in run
        return du_install.install.run(self)
      File "C:\Python27\lib\distutils\command\install.py", line 575, in run
        self.run_command(cmd_name)
      File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
        cmd_obj.run()
      File "C:\Python27\lib\site-packages\pbr\packaging.py", line 372, in run
        for args in get_script_args(dist, executable, is_wininst):
      File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 1934, in get_script_args
        header = get_script_header("", executable, wininst)
      File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 1603, in get_script_header
        if not isascii(hdr):
      File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line 86, in isascii
        unicode(s, 'ascii')
    TypeError: decoding Unicode is not supported

    ----------------------------------------
    Command "C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\rami~1.abu\\appdata\\local\\temp\\pip-build-mfyh2w\\sphinxcontrib-fulltoc\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\rami~1.abu\appdata\local\temp\pip-ienfui-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\rami~1.abu\appdata\local\temp\pip-build-mfyh2w\sphinxcontrib-fulltoc

Any ideas?

Thank you.

megha24 commented 8 years ago

Hi, i solved upgrading the setuptools by running: pip install -U setuptools

electrofelix commented 7 years ago

@megha24 thanks, a very old setuptools is what struck me as most likely source of the problem, though I did try testing with setuptools==0.6c11 and pip==1.5.4 and couldn't reproduce.

@ramiabughazaleh if you hit this again can you report the versions of setuptools and pip and I'll see if I can find the source, otherwise recommend running with a relatively recent version of both.