首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将ReadTheDocs托管在python3的家庭服务器中时出错

将ReadTheDocs托管在python3的家庭服务器中时出错
EN

Stack Overflow用户
提问于 2016-07-26 09:52:38
回答 1查看 124关注 0票数 0

我试图在本地系统(Ubuntu14.04)中安装python3虚拟env中的readthedocs。

当我运行pip3 install -r requirements.txt时,出现了Distutils2错误。我消除了这种依赖,因为distutils2不再受支持,并且假设setuptools就足够了。

运行此命令python manage.py迁移会产生以下错误:

代码语言:javascript
复制
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/home/username/read_the_docs_env/lib/python3.4/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/home/username/read_the_docs_env/lib/python3.4/site-packages/django/core/management/__init__.py", line 312, in execute
    django.setup()
  File "/home/username/read_the_docs_env/lib/python3.4/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/username/read_the_docs_env/lib/python3.4/site-packages/django/apps/registry.py", line 115, in populate
    app_config.ready()
  File "/home/username/read_the_docs_env/lib/python3.4/site-packages/django/contrib/admin/apps.py", line 22, in ready
    self.module.autodiscover()
  File "/home/username/read_the_docs_env/lib/python3.4/site-packages/django/contrib/admin/__init__.py", line 24, in autodiscover
    autodiscover_modules('admin', register_to=site)
  File "/home/username/read_the_docs_env/lib/python3.4/site-packages/django/utils/module_loading.py", line 74, in autodiscover_modules
    import_module('%s.%s' % (app_config.name, module_to_search))
  File "/home/username/read_the_docs_env/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/username/Desktop/CurrentProjects/read_the_docs/checkouts/readthedocs.org/readthedocs/core/admin.py", line 10, in <module>
    from readthedocs.core.views import SendEmailView
  File "/home/username/Desktop/CurrentProjects/read_the_docs/checkouts/readthedocs.org/readthedocs/core/views/__init__.py", line 26, in <module>
    from readthedocs.projects.tasks import remove_dir
  File "/home/username/Desktop/CurrentProjects/read_the_docs/checkouts/readthedocs.org/readthedocs/projects/tasks.py", line 493
    print "Sync Versions Exception: %s" % e.message
                                      ^
SyntaxError: Missing parentheses in call to 'print'

我从上面的堆栈跟踪中了解到,代码在python2中,所以print语句在python3中是不同的。

这是否意味着我必须在python2虚拟文件中安装readthedocs?

我们不能在readthedocs内部服务器中托管python3项目的文档吗?

EN

回答 1

Stack Overflow用户

发布于 2016-07-26 10:00:20

读取文档代码还不支持Python 3。安装说明明确表示要使用Python2.7:

首先,获取Python2.7和virtualenv

但是,仍然可以使用读取的docs安装来托管Python 3项目的docs,因为说明随后说:

如果您计划将Python3项目导入到您的RTD中,那么您还需要在您的系统中安装带有virtualenv的Python3。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38586585

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档