Readthedocs.org: Build failing: installing wrong package as flask

Created on 2 May 2018  路  15Comments  路  Source: readthedocs/readthedocs.org

Details

Expected Result

A successful build of the docs.

Actual Result

The build for my project's docs is failing. And, its...weird

When the build get's to the python setup.py install --force stage, it fails to find the correct flask package:

Installed /home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/latest/lib/python3.5/site-packages/PyJWT-1.6.1-py3.5.egg
Searching for flask
Downloading https://files.pythonhosted.org/packages/f8/41/24cddeaaf02e599bb4be168afa01a852b3577f87104d0b2012f69d895539/flask-buzz-0.1.4.tar.gz#sha256=d58e07b1975aaf8b6a1380bb2e0480c5452d0d26ba4d0a6775ff1536873a98d2
Best match: flask buzz-0.1.4
Processing flask-buzz-0.1.4.tar.gz
Writing /tmp/easy_install-5rlaieu5/flask-buzz-0.1.4/setup.cfg
Running flask-buzz-0.1.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-5rlaieu5/flask-buzz-0.1.4/egg-dist-tmp-6jxpcnhc
zip_safe flag not set; analyzing archive contents...
Removing /home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/latest/lib/python3.5/site-packages/flask_buzz-0.1.4-py3.5.egg
Moving flask_buzz-0.1.4-py3.5.egg to /home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/latest/lib/python3.5/site-packages
flask-buzz 0.1.4 is already the active version in easy-install.pth

Installed /home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/latest/lib/python3.5/site-packages/flask_buzz-0.1.4-py3.5.egg
error: The 'flask' distribution was not found and is required by flask-praetorian, flask-buzz

I have no idea why this is happening. I've looked around the configuration of flask-buzz, and I don't see any place where the name has a space that might confuse the python installer.

I really want to get this issue fixed because I just released my 0.4.0 version of my package, and it was a huge milestone. I really want to get the docs up and building so I can share with folks.

Thanks!

more information Support

Most helpful comment

Can you try wiping the environment? You can do this on the versions section (edit button)

All 15 comments

Try with the name Flask (uppercase F), that's the registered name on pypi https://pypi.org/project/Flask/

Have you tried running python setup.py install in your local machine with a fresh virtualenv? It must fail because you have added flask with small charector. It seems like pypi is case sensitive so its not finding the package.
I have tried changing the name locally and the installation seems to be successful.

So change the name to Flask will solve your problem.

Ok, updating the case of the Flask dependency got the build past that part. Now, however, there's another weird error that's leaving me baffled:

https://readthedocs.org/projects/flask-praetorian/builds/7132433/

Running Sphinx v1.7.4
loading translations [en]... done
making output directory...
loading pickled environment... not yet created

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/latest/lib/python3.5/site-packages/sphinx/cmdline.py", line 303, in main
    args.warningiserror, args.tags, args.verbosity, args.jobs)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/latest/lib/python3.5/site-packages/sphinx/application.py", line 233, in __init__
    self._init_builder()
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/latest/lib/python3.5/site-packages/sphinx/application.py", line 310, in _init_builder
    self.builder.init()
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/latest/lib/python3.5/site-packages/sphinx/builders/html.py", line 258, in init
    self.init_templates()
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/latest/lib/python3.5/site-packages/sphinx/builders/html.py", line 305, in init_templates
    self.theme = theme_factory.create(themename)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/latest/lib/python3.5/site-packages/sphinx/theming.py", line 277, in create
    self.load_extra_theme(name)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/latest/lib/python3.5/site-packages/sphinx/theming.py", line 199, in load_extra_theme
    self.load_external_theme(name)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/latest/lib/python3.5/site-packages/sphinx/theming.py", line 227, in load_external_theme
    self.app.registry.load_extension(self.app, entry_point.module_name)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/latest/lib/python3.5/site-packages/sphinx/registry.py", line 326, in load_extension
    metadata = mod.setup(app)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/latest/lib/python3.5/site-packages/Pallets_Sphinx_Themes-1.0.1-py3.5.egg/pallets_sphinx_themes/__init__.py", line 30, in setup
    VersionManager(app)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/latest/lib/python3.5/site-packages/Pallets_Sphinx_Themes-1.0.1-py3.5.egg/pallets_sphinx_themes/versions.py", line 38, in __init__
    if self.current is None and version.slug == current_slug:
AttributeError: 'tuple' object has no attribute 'slug'

Exception occurred:
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/latest/lib/python3.5/site-packages/Pallets_Sphinx_Themes-1.0.1-py3.5.egg/pallets_sphinx_themes/versions.py", line 38, in __init__
    if self.current is None and version.slug == current_slug:
AttributeError: 'tuple' object has no attribute 'slug'
The full traceback has been saved in /tmp/sphinx-err-z0_7e3h_.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!

Looks like an incompatibility between packages, I recommend putting an upper and lower version for your dependencies. This isn't a rtd issue.

@stsewd I disagree. The package builds fine on travis.ci spanning 4 versions of python3 and on my local machine. This isn't an issue in the build/install of the package anyway. This error is happening while building the docs.

I can build the docs locally using the exact same build command less the readthedocs builder:

// [tbeck-workstation:~/work/flask-praetorian/docs][2018-05-03 09:10:31] (master) 
/venv:praetorian/ $ sphinx-build -T -d _build/doctrees-readthedocs -D language=en . _build/html
Running Sphinx v1.7.4
loading translations [en]... done
loading pickled environment... not yet created
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 8 source files that are out of date
updating environment: 8 added, 0 changed, 0 removed
reading sources... [100%] tutorial                                                                                                                                                                                                                                             
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... WARNING: unsupported theme option 'index_logo' given
done
writing output... [100%] tutorial                                                                                                                                                                                                                                              
generating indices... genindex py-modindex
writing additional pages... search
copying images... [100%] _static/tutorial-blacklist-2.png                                                                                                                                                                                                                      
copying static files... done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded, 1 warnings.

The HTML pages are in _build/html.

So, it seems that it is an rtd issue.

I dug into it a bit more. It seems like the issue here is using the "flask" theme. This is a requirement for "approved flask extensions". Talking with the lead dev on flask, it sounds like these requirements aren't as strict as they once were. Transitioning to the 'alabaster' theme let the docs build.

Closing this. Thanks for help

Seems like installing the wrong package instead of flask is still happening even with proper casing. See https://readthedocs.org/projects/flask-praetorian/builds/7136475/

Installed /home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/stable/lib/python3.5/site-packages/PyJWT-1.6.1-py3.5.egg
Searching for Flask
Downloading https://files.pythonhosted.org/packages/f8/41/24cddeaaf02e599bb4be168afa01a852b3577f87104d0b2012f69d895539/flask-buzz-0.1.4.tar.gz#sha256=d58e07b1975aaf8b6a1380bb2e0480c5452d0d26ba4d0a6775ff1536873a98d2
Best match: flask buzz-0.1.4
Processing flask-buzz-0.1.4.tar.gz
Writing /tmp/easy_install-x0fhefey/flask-buzz-0.1.4/setup.cfg
Running flask-buzz-0.1.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-x0fhefey/flask-buzz-0.1.4/egg-dist-tmp-9rz846ll
zip_safe flag not set; analyzing archive contents...
Removing /home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/stable/lib/python3.5/site-packages/flask_buzz-0.1.4-py3.5.egg
Moving flask_buzz-0.1.4-py3.5.egg to /home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/stable/lib/python3.5/site-packages
flask-buzz 0.1.4 is already the active version in easy-install.pth

Installed /home/docs/checkouts/readthedocs.org/user_builds/flask-praetorian/envs/stable/lib/python3.5/site-packages/flask_buzz-0.1.4-py3.5.egg
error: The 'Flask' distribution was not found and is required by flask-praetorian, flask-buzz

The problem is with the theme itself: pallets_sphinx_theme

You will need to dig a little into that to understand what's the problem there. Probably the context sent is different from the context expected by the theme.

@humitos I've removed that as a dependency, so that shouldn't be the cause of this issue any more

Can you try wiping the environment? You can do this on the versions section (edit button)

@stsewd Same issue happened after triggering a build following a wipe of both 'latest' and 'stable':

https://readthedocs.org/projects/flask-praetorian/builds/7159864/

I was able to work-around this issue by pinning my flask dependency. However, this is a less than desirable way of dealing with the issue. I'd still like to figure out why this is happening

Hi I get the same error when I tried to build devartoria/flask (fork of pallets/flask for translation.) docs.
It absolutely appears to be a matter of pallets-sphinx theme.

Running Sphinx v1.6.5
making output directory...
loading translations [ko]... done
loading pickled environment... not yet created

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-kr/envs/kor_docs/local/lib/python2.7/site-packages/sphinx/cmdline.py", line 305, in main
    opts.warningiserror, opts.tags, opts.verbosity, opts.jobs)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-kr/envs/kor_docs/local/lib/python2.7/site-packages/sphinx/application.py", line 234, in __init__
    self._init_builder()
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-kr/envs/kor_docs/local/lib/python2.7/site-packages/sphinx/application.py", line 311, in _init_builder
    self.builder.init()
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-kr/envs/kor_docs/local/lib/python2.7/site-packages/sphinx/builders/html.py", line 202, in init
    self.init_templates()
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-kr/envs/kor_docs/local/lib/python2.7/site-packages/sphinx/builders/html.py", line 245, in init_templates
    self.theme = theme_factory.create(themename)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-kr/envs/kor_docs/local/lib/python2.7/site-packages/sphinx/theming.py", line 276, in create
    self.load_extra_theme(name)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-kr/envs/kor_docs/local/lib/python2.7/site-packages/sphinx/theming.py", line 198, in load_extra_theme
    self.load_external_theme(name)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-kr/envs/kor_docs/local/lib/python2.7/site-packages/sphinx/theming.py", line 226, in load_external_theme
    self.app.registry.load_extension(self.app, entry_point.module_name)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-kr/envs/kor_docs/local/lib/python2.7/site-packages/sphinx/registry.py", line 207, in load_extension
    metadata = mod.setup(app)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-kr/envs/kor_docs/local/lib/python2.7/site-packages/Pallets_Sphinx_Themes-1.0.1-py2.7.egg/pallets_sphinx_themes/__init__.py", line 30, in setup
    VersionManager(app)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-kr/envs/kor_docs/local/lib/python2.7/site-packages/Pallets_Sphinx_Themes-1.0.1-py2.7.egg/pallets_sphinx_themes/versions.py", line 38, in __init__
    if self.current is None and version.slug == current_slug:
AttributeError: 'tuple' object has no attribute 'slug'

Exception occurred:
  File "/home/docs/checkouts/readthedocs.org/user_builds/flask-kr/envs/kor_docs/local/lib/python2.7/site-packages/Pallets_Sphinx_Themes-1.0.1-py2.7.egg/pallets_sphinx_themes/versions.py", line 38, in __init__
    if self.current is None and version.slug == current_slug:
AttributeError: 'tuple' object has no attribute 'slug'
The full traceback has been saved in /tmp/sphinx-err-rkRbUm.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!

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. Thanks!

I think this looks like a problem with the package itself, or maybe a bug with pip. Anyway, we are installing the latest version of pip before each build. Or maybe it could be related to https://github.com/rtfd/readthedocs.org/issues/5018. Anyway, if someone else is having the same problem we can re-open and investigate more.

Was this page helpful?
0 / 5 - 0 ratings