【问题标题】:python: can't open file 'scriptbootstrap.py'python:无法打开文件'scriptbootstrap.py'
【发布时间】:2016-12-21 00:58:29
【问题描述】:

我正在尝试通过https://github.com/electron/electron/blob/master/docs/development/build-instructions-windows.md在 Windows 上启动电子应用程序

我已经成功完成了前两个步骤,但卡在了建筑部分。

当我尝试运行python script\build.py时,出现以下错误:

python: can't open file 'scriptbootstrap.py': [Errno 2] No such file or directory

而不仅仅是这个命令。我运行的任何命令,例如python script\build.py -c D,也会给我带来麻烦。我正在通过 windows bash 运行命令

我认为它应该寻找 script/bootstrap.py 而是寻找

【问题讨论】:

  • 此文件不存在或您无权访问。
  • 感谢您的评论。该文件存在于 script/bootstrap.py 中,但它查看的是 scriptbootstrap.py

标签: javascript python node.js electron


【解决方案1】:

首先,我想知道python script\bootstrap.py -v 是否适合您。

在我的机器上查看示例输出(使用 git bash)

Anubhavs@DDSPL1392 MINGW64 /e/Projects/electron (master)
$ python script/bootstrap.py -v
Submodule 'vendor/boto' (https://github.com/boto/boto.git) registered for path 'vendor/boto'
Submodule 'vendor/breakpad' (https://github.com/electron/chromium-breakpad.git) registered for path 'vendor/breakpad'
Submodule 'vendor/brightray' (https://github.com/electron/brightray.git) registered for path 'vendor/brightray'
Submodule 'vendor/crashpad' (https://github.com/electron/crashpad.git) registered for path 'vendor/crashpad'
Submodule 'vendor/depot_tools' (https://chromium.googlesource.com/chromium/tools/depot_tools.git) registered for path 'vendor/depot_tools'
Submodule 'vendor/native_mate' (https://github.com/zcbenz/native-mate.git) registered for path 'vendor/native_mate'
Submodule 'vendor/node' (https://github.com/electron/node.git) registered for path 'vendor/node'
Submodule 'vendor/requests' (https://github.com/kennethreitz/requests) registered for path 'vendor/requests'
Cloning into 'vendor/boto'...
remote: Counting objects: 42186, done.
<more lines cloning different dependencies.>
.
.
.

第二, 我建议在路径中使用 '/' 而不是 '\' 。这在 Windows cmd 中运行良好。但是,不是跨不同脚本处理路径的方式。 '/' 总是有效的。

运行两个命令,python script\bootstrap.py -v 作为python script/bootstrap.py -vpython script\build.py 作为python script/build.py

【讨论】:

    猜你喜欢
    • 2017-05-19
    • 2013-02-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-06
    • 2016-10-10
    • 1970-01-01
    • 1970-01-01
    • 2022-08-13
    相关资源
    最近更新 更多