无法安装Oppia

时间:2014-07-01 02:42:41

标签: java python python-2.7 zip

当我尝试执行Oppia的安装过程时,会抛出一条错误消息:

    Building languages list.
Compiling repl.coffee.
   minifying tmp/jsrepl.js using java -Xmx1g -jar ./tools/closure-compiler/trunk/build/compiler.jar --compilation_level SIMPLE_OPTIMIZATIONS --js
Done.
Downloading file yuicompressor-2.4.8.jar to ../oppia_tools/yuicompressor-2.4.8
Downloading file ui-bootstrap-tpls-0.10.0.js to ./third_party/static/ui-bootstrap-0.10.0
Downloading file ui-bootstrap-tpls-0.10.0.min.js to ./third_party/static/ui-bootstrap-0.10.0
Downloading file jquery.js to ./third_party/static/jquery-2.0.3
Downloading file jquery.min.js to ./third_party/static/jquery-2.0.3
Downloading file jquery.min.map to ./third_party/static/jquery-2.0.3
Downloading file jquery-ui.min.js to ./third_party/static/jqueryui-1.10.3
Downloading file angular.js to ./third_party/static/angularjs-1.2.0-rc.3
Downloading file angular.min.js to ./third_party/static/angularjs-1.2.0-rc.3
Downloading file angular.min.js.map to ./third_party/static/angularjs-1.2.0-rc.3
Downloading file angular-resource.js to ./third_party/static/angularjs-1.2.0-rc.3
Downloading file angular-resource.min.js to ./third_party/static/angularjs-1.2.0-rc.3
Downloading file angular-resource.min.js.map to ./third_party/static/angularjs-1.2.0-rc.3
Downloading file angular-route.js to ./third_party/static/angularjs-1.2.0-rc.3
Downloading file angular-route.min.js to ./third_party/static/angularjs-1.2.0-rc.3
Downloading file angular-route.min.js.map to ./third_party/static/angularjs-1.2.0-rc.3
Downloading file angular-sanitize.js to ./third_party/static/angularjs-1.2.0-rc.3
Downloading file angular-sanitize.min.js to ./third_party/static/angularjs-1.2.0-rc.3
Downloading file angular-sanitize.min.js.map to ./third_party/static/angularjs-1.2.0-rc.3
Downloading file angular-mocks.js to ./third_party/static/angularjs-1.2.0-rc.3
Downloading file angular-scenario.js to ./third_party/static/angularjs-1.2.0-rc.3
Downloading file d3.min.js to ./third_party/static/d3js-3.2.8
Downloading and unzipping file select2-3.4.1 to ./third_party/static
Traceback (most recent call last):
  File "scripts/install_third_party.py", line 260, in <module>
    SELECT2_ZIP_ROOT_NAME, SELECT2_TARGET_ROOT_NAME)
  File "scripts/install_third_party.py", line 83, in download_and_unzip_files
    with zipfile.ZipFile(TMP_UNZIP_PATH, 'r') as z:
AttributeError: ZipFile instance has no attribute '__exit__'

我无法理解错误消息。我应该安装一些软件包(用于ZIP)吗?

1 个答案:

答案 0 :(得分:0)

您(或安装程序)是否实际运行Python 2.7?

行:with zipfile.ZipFile(TMP_UNZIP_PATH, 'r') as z:with语句,它需要ZipFile实例来支持上下文管理器接口,即需要定义__enter__()__exit__()方法。 / p>

在2.7版本中添加了对ZipFile的上下文管理器支持,对于Python 3,它在3.2中添加了。您没有使用正确的Python版本。