2016-07-26 23 views
0

我想从这个link错误主机在内部服务器ReadTheDocs在python3

给出的说明安装在本地系统中python3虚拟ENV readthedocs(Ubuntu的14.04),当我跑PIP3安装-r要求。 txt,我得到了Distutils2错误。由于distutils2不再被支持,并假定setuptools就足够了,所以我删除了这个依赖关系。

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

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等打印语句是python3不同的理解。

这是否意味着我必须在python2 virtualenv中安装readthedocs?

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

+0

在Python 3中'print'是一个函数,它必须作为一个函数调用:'print(...)'。 –

+0

如果你想创建一个python2 venv,你必须明确地给解释器提供'-p'参数。 –

+0

是的,这是问题所在。这意味着readthedocs代码在python2中,这就是为什么当我将它安装在python3 virtualenv中时发生错误的原因。问题是我们如何将它安装在python3 virtualenv中。 –

回答

1

阅读文档代码还不支持Python 3。该installation instructions明确地说,使用Python 2.7:

首先,获得的Python 2.7和virtualenv中

然而,应该还是有可能使用你的阅读文档安装到主机为Python 3个项目文档,因为这些说明然后会说:

如果您打算将Python 3项目导入到您的RTD,那么您需要在系统中安装带有virtualenv的Python 3。

相关问题