1

テスト プロジェクトで django-pipeline をセットアップしようとしていますが、明確な解決策がないバグに遭遇しています。これは、settings.py で構成されたパイプラインです。

PIPELINE = {
    'PIPELINE_ENABLED': True,
    'COMPILERS': ('pipeline_browserify.compiler.BrowserifyCompiler', ),
    'CSS_COMPRESSOR': 'pipeline.compressors.NoopCompressor', 
    'JS_COMPRESSOR': 'pipeline.compressors.uglifyjs.UglifyJSCompressor',
    'STYLESHEETS': {  
    #    'animelist_css': {
    #        'source_filenames': ( 'animelist/css/style.css', ),
    #        'output_filename': 'animelist/css/animelist_css.css',
    #    }
    },
    'JAVASCRIPT': {  
    #  'animelist_js': {
    #       'source_filenames': (
        #    'animelist/js/bower_components/jquery/dist/jquery.min.js',
        #    'animelist/js/bower_components/react/JSXTransformer.js',
        #    'animelist/js/bower_components/react/react-with-addons.js',
        #    'animelist/js/app.browserify.js',
       #      ),
       #     'output_filename': 'animelist/js/animelist_js.js',
      #  }
    }
}

構成からわかるように、この設定により、collectstatic を問題なく実行できます。ただし、これらの行のコメントを外すと、collectstatic は失敗します。以下にエラーを示します。設定で指定された宛先の場所で静的ファイルを収集するように要求しました。

    /var/www/anime/static

This will overwrite existing files!
Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: yes
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/virtualenvs/django_project/lib64/python3.4/site-    packages/django/core/management/__init__.py", line 338, in     execute_from_command_line
    utility.execute()
  File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/core/management/__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/core/management/base.py", line 390, in run_from_argv
self.execute(*args, **cmd_options)
  File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/core/management/base.py", line 441, in execute
output = self.handle(*args, **options)
  File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 168, in handle
collected = self.collect()
  File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 114, in collect
for original_path, processed_path, processed in processor:
  File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline/storage.py", line 33, in post_process
packager.pack_javascripts(package)
  File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline/packager.py", line 112, in pack_javascripts
return self.pack(package, self.compressor.compress_js, js_compressed, templates=package.templates, **kwargs)
  File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline/packager.py", line 105, in pack
paths = self.compile(package.paths, force=True)
  File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline/packager.py", line 99, in compile
return self.compiler.compile(paths, force=force)
  File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/pipeline/compilers/__init__.py", line 49, in compile
from concurrent import futures
  File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/concurrent/futures/__init__.py", line 8, in <module>
from concurrent.futures._base import (FIRST_COMPLETED,
  File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/concurrent/futures/_base.py", line 355
    raise type(self._exception), self._exception, self._traceback
                           ^
SyntaxError: invalid syntax

助けていただければ幸いです。

4

1 に答える 1

0

どうやら、エラーはpip3にフューチャーバックポートをインストールした結果です。pip3 で futures パッケージをアンインストールするだけです。

于 2016-01-20T10:24:01.080 に答える