csdl / makahiki

An Open Source "Serious Game" Framework for Sustainability
http://makahiki.readthedocs.org/
MIT License
7 stars 5 forks source link

Sphinx build cannot import setup_environ (deprecated in 1.6) #581

Closed jtakayama closed 10 years ago

jtakayama commented 10 years ago

The Sphinx build fails in Django 1.6 because setup_environ cannot be imported. django.core.management.setup_environ was removed in 1.6 (https://docs.djangoproject.com/en/1.4/internals/deprecation/#id3).

This bug occurs in Vagrant (Ubuntu 12.04 LTS virtual machine) and on an Ubuntu 12.04.2 LTS virtual machine.

This may be related to the latest version of http://makahiki.readthedocs.org/en/latest/installation-makahiki-vagrant-configuration-vagrant.html pushed in merge #579 not appearing in the documentation after the merge.

Example output:

vagrant@precise32:/vagrant/doc$ make html
sphinx-build -b html -d _build/doctrees   . _build/html
Making output directory...
Running Sphinx v1.1.3

Exception occurred:
  File "/vagrant/doc/conf.py", line 350, in 
    from django.core.management import setup_environ
ImportError: cannot import name setup_environ
The full traceback has been saved in /tmp/sphinx-err-JZBJ_3.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.
Either send bugs to the mailing list at , or report them in the tracker at . Thanks!
make: *** [html] Error 1
vagrant@precise32:/vagrant/doc$
jtakayama commented 10 years ago

Contents of /tmp/sphinx-err-JZBJ_3.log (from an Ubuntu 12.04 LTS VM, Vagrant with VirtualBox):

# Sphinx version: 1.1.3
# Python version: 2.7.3
# Docutils version: 0.11 release
# Jinja2 version: 2.7.1
Traceback (most recent call last):
  File "/home/tester/.virtualenvs/makahiki/local/lib/python2.7/site-packages/sphinx/cmdline.py", line 188, in main
    warningiserror, tags)
  File "/home/tester/.virtualenvs/makahiki/local/lib/python2.7/site-packages/sphinx/application.py", line 102, in __init__
    confoverrides or {}, self.tags)
  File "/home/tester/.virtualenvs/makahiki/local/lib/python2.7/site-packages/sphinx/config.py", line 216, in __init__
    exec code in config
  File "/home/tester/makahiki/doc/conf.py", line 350, in 
    from django.core.management import setup_environ
ImportError: cannot import name setup_environ
jtakayama commented 10 years ago

The same error in an Ubuntu 12.04.2 LTS VM in VirtualBox (without Vagrant):

(makahiki)tester@Makahiki-Heroku-Test:~/makahiki/doc$ make html
sphinx-build -b html -d _build/doctrees   . _build/html
Running Sphinx v1.1.3
Exception occurred:
  File "/home/tester/makahiki/doc/conf.py", line 350, in 
    from django.core.management import setup_environ
ImportError: cannot import name setup_environ
The full traceback has been saved in /tmp/sphinx-err-LbLhaN.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.
Either send bugs to the mailing list at , or report them in the tracker at . Thanks!
make: *** [html] Error 1
(makahiki)tester@Makahiki-Heroku-Test:~/makahiki/doc$ cat /tmp/sphinx-err-LbLhaN.log 
# Sphinx version: 1.1.3
# Python version: 2.7.3
# Docutils version: 0.11 release
# Jinja2 version: 2.7.1
Traceback (most recent call last):
  File "/home/tester/.virtualenvs/makahiki/local/lib/python2.7/site-packages/sphinx/cmdline.py", line 188, in main
    warningiserror, tags)
  File "/home/tester/.virtualenvs/makahiki/local/lib/python2.7/site-packages/sphinx/application.py", line 102, in __init__
    confoverrides or {}, self.tags)
  File "/home/tester/.virtualenvs/makahiki/local/lib/python2.7/site-packages/sphinx/config.py", line 216, in __init__
    exec code in config
  File "/home/tester/makahiki/doc/conf.py", line 350, in 
    from django.core.management import setup_environ
ImportError: cannot import name setup_environ
(makahiki)tester@Makahiki-Heroku-Test:~/makahiki/doc$ 
yongwen commented 10 years ago

fixed the conf.py to use the django models.meta.fields instead of _fields()

On Mon, Dec 2, 2013 at 1:10 PM, Jordan Takayama notifications@github.comwrote:

The same error in an Ubuntu 12.04.2 LTS VM in VirtualBox:

(makahiki)tester@Makahiki-Heroku-Test:~/makahiki/doc$ make html sphinx-build -b html -d _build/doctrees . _build/html Running Sphinx v1.1.3

Exception occurred: File "/home/tester/makahiki/doc/conf.py", line 350, in from django.core.management import setup_environ ImportError: cannot import name setup_environ The full traceback has been saved in /tmp/sphinx-err-LbLhaN.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. Either send bugs to the mailing list at , or report them in the tracker at . Thanks! make: *\ [html] Error 1 (makahiki)tester@Makahiki-Heroku-Test:~/makahiki/doc$ cat /tmp/sphinx-err-LbLhaN.log

Sphinx version: 1.1.3

Python version: 2.7.3

Docutils version: 0.11 release

Jinja2 version: 2.7.1

Traceback (most recent call last): File "/home/tester/.virtualenvs/makahiki/local/lib/python2.7/site-packages/sphinx/cmdline.py", line 188, in main warningiserror, tags) File "/home/tester/.virtualenvs/makahiki/local/lib/python2.7/site-packages/sphinx/application.py", line 102, in init confoverrides or {}, self.tags) File "/home/tester/.virtualenvs/makahiki/local/lib/python2.7/site-packages/sphinx/config.py", line 216, in init exec code in config File "/home/tester/makahiki/doc/conf.py", line 350, in from django.core.management import setup_environ ImportError: cannot import name setup_environ (makahiki)tester@Makahiki-Heroku-Test:~/makahiki/doc$

— Reply to this email directly or view it on GitHubhttps://github.com/csdl/makahiki/issues/581#issuecomment-29668088 .

jtakayama commented 10 years ago

The documentation build works now.