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

Cant make html, getting 'Module_six_moves_urllib_parse' object has no attribute 'urlsplit' errror #2684

Closed
vincentmaithu opened this issue Jun 16, 2016 · 11 comments

Comments

@vincentmaithu
Copy link

Full stack trace below,
Ive installed latest version of six but no joy, still cannot run 'make html' for Sphinx to render locally.

Sphinx version: 1.4.1

Python version: 2.7.10 (CPython)

Docutils version: 0.12 release

Jinja2 version: 2.8

Last messages:

Loaded extensions:

Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/sphinx/cmdline.py", line 243, in main
opts.warningiserror, opts.tags, opts.verbosity, opts.jobs)
File "/Library/Python/2.7/site-packages/sphinx/application.py", line 197, in init
self._init_builder(self.buildername)
File "/Library/Python/2.7/site-packages/sphinx/application.py", line 269, in _init_builder
self.emit('builder-inited')
File "/Library/Python/2.7/site-packages/sphinx/application.py", line 536, in emit
results.append(callback(self, *args))
File "/Library/Python/2.7/site-packages/sphinx/ext/intersphinx.py", line 291, in load_mappings
safe_inv_url = _get_safe_url(inv)
File "/Library/Python/2.7/site-packages/sphinx/ext/intersphinx.py", line 205, in _get_safe_url
url, username, _ = _strip_basic_auth(url)
File "/Library/Python/2.7/site-packages/sphinx/ext/intersphinx.py", line 148, in _strip_basic_auth
url_parts = parse.urlsplit(url)
AttributeError: 'Module_six_moves_urllib_parse' object has no attribute 'urlsplit'

@tk0miya
Copy link
Member

tk0miya commented Jun 16, 2016

It's a bit strange.
Could you add following code into your conf.py and execute again please?

import six
print six.__version__

@vincentmaithu
Copy link
Author

sphinx-build -b html -d build/doctrees source build/html
Running Sphinx v1.4.1
1.4.1
loading pickled environment... not yet created

Exception occurred:
File "/Library/Python/2.7/site-packages/sphinx/ext/intersphinx.py", line 148, in _strip_basic_auth
url_parts = parse.urlsplit(url)
AttributeError: 'Module_six_moves_urllib_parse' object has no attribute 'urlsplit'
The full traceback has been saved in /var/folders/g5/j1dpbw856fs0kk2nghyhtnsh0000gp/T/sphinx-err-zRysb1.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at https://github.com/sphinx-doc/sphinx/issues. Thanks!
make: *** [html] Error 1

@tk0miya
Copy link
Member

tk0miya commented Jun 16, 2016

Running Sphinx v1.4.1
1.4.1

It seems six-1.4.1 is used. Could you check your environment?

@vincentmaithu
Copy link
Author

I've no virtual env running. Never needed one. Do I now?

@tk0miya
Copy link
Member

tk0miya commented Jun 18, 2016

Finally, I found the root of this problem.
sphinx.ext.intersphinx always crashes with six-1.4.1.
I fixed it at 7586297.
As a workaround, please update six to 1.5.0 or newer.

Note: following code crashes with six-1.4.1:

from six.moves.urllib import parse
from six.moves.urllib.parse import urlsplit

parse.urlsplit  # => AttributeError

@tk0miya tk0miya closed this as completed Jun 18, 2016
@tk0miya tk0miya added this to the 1.4.5 milestone Jun 18, 2016
@vincentmaithu
Copy link
Author

vincentmaithu commented Jun 20, 2016

When I update my six i still get the error
`(ENV) MTTUsers-MacBook-Pro-18:ENV vincento$ pip install six==1.5.0
Collecting six==1.5.0
Using cached six-1.5.0-py2.py3-none-any.whl
Installing collected packages: six
Successfully installed six-1.5.0
(ENV) MTTUsers-MacBook-Pro-18:ENV vincento$ cd ..
(ENV) MTTUsers-MacBook-Pro-18:docs vincento$ make html
sphinx-build -b html -d build/doctrees source build/html
Running Sphinx v1.4.1
1.4.1
loading pickled environment... not yet created

Exception occurred:
File "/Library/Python/2.7/site-packages/sphinx/ext/intersphinx.py", line 148, in _strip_basic_auth
url_parts = parse.urlsplit(url)
AttributeError: 'Module_six_moves_urllib_parse' object has no attribute 'urlsplit'
The full traceback has been saved in /var/folders/g5/j1dpbw856fs0kk2nghyhtnsh0000gp/T/sphinx-err-fE9qKc.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at https://github.com/sphinx-doc/sphinx/issues. Thanks!
`

@vincentmaithu
Copy link
Author

Just found the issue. I needed to update Sphinx to 1.4.4

@tk0miya
Copy link
Member

tk0miya commented Jun 22, 2016

sphinx-build -b html -d build/doctrees source build/html
Running Sphinx v1.4.1
1.4.1
loading pickled environment... not yet created

It seems sphinx does not recognize six-1.5.0 you installed. How did you install sphinx?

@vincentmaithu
Copy link
Author

pip install -U Sphinx

@tk0miya
Copy link
Member

tk0miya commented Jun 26, 2016

Hmm, it seems your python environment is broken. Please check your environment. In fact, your sphinx does not recognize the new six package.
Sorry I can't help you.

@vincentmaithu
Copy link
Author

Hey no problem, thanks for responding.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants