我无法在 Atom 中安装 Jupyter Notebook。我收到这些错误。
[email protected] install /tmp/apm-install-dir-11881-6115-cmx7ut.qatf6tuik9/node_modules/jupyter-notebook/node_modules/bufferutil
node-gyp rebuild
[email protected] install /tmp/apm-install-dir-11881-6115-cmx7ut.qatf6tuik9/node_modules/jupyter-notebook/node_modules/utf-8-validate
node-gyp rebuild
[email protected] install /tmp/apm-install-dir-11881-6115-cmx7ut.qatf6tuik9/node_modules/jupyter-notebook/node_modules/pathwatcher
node-gyp rebuild
/tmp/apm-install-dir-11881-6115-cmx7ut.qatf6tuik9
└── (empty)
npm WARN deprecated [email protected]: This package has moved to @jupyterlab/services
npm WARN deprecated [email protected]: use @phosphor/ packages
gyp ERR! configure error
gyp ERR! stack Error: Python executable "/snap/atom/192/usr/share/atom/resources/app/apm/bin/python-interceptor.sh" is v3.7.0, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack at failPythonVersion (/snap/atom/192/usr/share/atom/resources/app/apm/node_modules/node-gyp/lib/configure.js:454:14)
gyp ERR! stack at /snap/atom/192/usr/share/atom/resources/app/apm/node_modules/node-gyp/lib/configure.js:443:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:197:7)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at maybeClose (internal/child_process.js:877:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
gyp ERR! System Linux 4.15.0-30-generic
gyp ERR! command "/snap/atom/192/usr/share/atom/resources/app/apm/bin/node" "/snap/atom/192/usr/share/atom/resources/app/apm/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /tmp/apm-install-dir-11881-6115-cmx7ut.qatf6tuik9/node_modules/jupyter-notebook/node_modules/bufferutil
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
gyp ERR! configure error
gyp ERR! stack Error: Python executable "/snap/atom/192/usr/share/atom/resources/app/apm/bin/python-interceptor.sh" is v3.7.0, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack at failPythonVersion (/snap/atom/192/usr/share/atom/resources/app/apm/node_modules/node-gyp/lib/configure.js:454:14)
gyp ERR! stack at /snap/atom/192/usr/share/atom/resources/app/apm/node_modules/node-gyp/lib/configure.js:443:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:197:7)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at maybeClose (internal/child_process.js:877:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
gyp ERR! System Linux 4.15.0-30-generic
gyp ERR! command "/snap/atom/192/usr/share/atom/resources/app/apm/bin/node" "/snap/atom/192/usr/share/atom/resources/app/apm/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /tmp/apm-install-dir-11881-6115-cmx7ut.qatf6tuik9/node_modules/jupyter-notebook/node_modules/utf-8-validate
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
gyp ERR! configure error
gyp ERR! stack Error: Python executable "/snap/atom/192/usr/share/atom/resources/app/apm/bin/python-interceptor.sh" is v3.7.0, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack at failPythonVersion (/snap/atom/192/usr/share/atom/resources/app/apm/node_modules/node-gyp/lib/configure.js:454:14)
gyp ERR! stack at /snap/atom/192/usr/share/atom/resources/app/apm/node_modules/node-gyp/lib/configure.js:443:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:197:7)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at maybeClose (internal/child_process.js:877:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
gyp ERR! System Linux 4.15.0-30-generic
gyp ERR! command "/snap/atom/192/usr/share/atom/resources/app/apm/bin/node" "/snap/atom/192/usr/share/atom/resources/app/apm/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /tmp/apm-install-dir-11881-6115-cmx7ut.qatf6tuik9/node_modules/jupyter-notebook/node_modules/pathwatcher
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/tmp/apm-install-dir-11881-6115-cmx7ut.qatf6tuik9/package.json'
npm WARN apm-install-dir-11881-6115-cmx7ut.qatf6tuik9 No description
npm WARN apm-install-dir-11881-6115-cmx7ut.qatf6tuik9 No repository field.
npm WARN apm-install-dir-11881-6115-cmx7ut.qatf6tuik9 No README data
npm WARN apm-install-dir-11881-6115-cmx7ut.qatf6tuik9 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/jupyter-notebook/node_modules/bufferutil):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/jupyter-notebook/node_modules/utf-8-validate):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! Linux 4.15.0-30-generic
npm ERR! argv "/snap/atom/192/usr/share/atom/resources/app/apm/bin/node" "/snap/atom/192/usr/share/atom/resources/app/apm/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/home/nikolay/.atom/.apm/.apmrc" "--userconfig" "/home/nikolay/.atom/.apmrc" "install" "/tmp/d-11881-6115-1fr4y32.psvjd4e7b9/package.tgz" "--runtime=electron" "--target=2.0.5" "--arch=x64" "--global-style"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the pathwatcher package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs pathwatcher
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls pathwatcher
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /tmp/apm-install-dir-11881-6115-cmx7ut.qatf6tuik9/npm-debug.log
npm ERR! code 1
答案1
jupyter-notebook是一个 Atom 包,其工作方式与 Jupyter Notebook 类似,但位于 Atom 内部。它注册为 .ipynb 文件的打开器。
要在 Ubuntu 20.04 及更高版本中安装 jupyter-notebook,请打开终端并输入:
sudo apt-get install python-all python3-pip jupyter-notebook jupyter
sudo pip3 install jupyter_kernel_gateway
apm install jupyter-notebook # or search for jupyter-notebook package inside of Atom
要在 Ubuntu 18.04-19.10 中安装 jupyter-notebook,请打开终端并输入:
sudo apt-get install python-all python3-pip python3-notebook jupyter jupyter-core python-ipykernel
sudo pip3 install jupyter_kernel_gateway
apm install jupyter-notebook # or search for jupyter-notebook package inside of Atom
用法:
运行单元:Shift+Enter
如果您没有运行 Ubuntu 18.04,安装 Jupyter Notebook 的说明会更复杂一些。如果您需要将这些说明添加到此答案中,请发表评论。